ParseFile error when generating Swagger docs - go

I'm using Swagger to generate docs with Golang.
I have generated successfully for a few times. However, the last time I ran swag init (at root folder), it ran into this problem:
swag init
2019/07/17 11:10:43 Generate swagger docs....
2019/07/17 11:10:43 Generate general API Info, search dir:./
2019/07/17 11:10:48 ParseFile error:pkg/mod/golang.org/x/tools#v0.0.0-20190712213246-8b927904ee0d/cmd/fiximports/testdata/src/old.com/bad/bad.go:2:43: expected 'package', found 'EOF'
What is this error and how to fix it?

I recently faced the same issue; it resolved after installing previous version of swag.
The command to install that specific version is:
go get -u github.com/swaggo/swag/cmd/swag#v1.4.1

Related

TypeError: from_pretrained() got an unexpected keyword argument 'file_name'

I'm trying to quantize a seq2seq model (M2M100) using optimum library provided by Huggingface. As per this guide, I'm trying to quantize the encoder and decoder one by one but that requires me to overwrite the model name. Following the documentation in the guide, I used the code:
encoder_quantizer = ORTQuantizer.from_pretrained(model_dir, file_name="encoder_model.onnx")
This code is throwing the following error:
TypeError: from_pretrained() got an unexpected keyword argument 'file_name'
I tried examining ORTQuantizer.from_pretrained and got the following:
<function optimum.onnxruntime.quantization.ORTQuantizer.from_pretrained(model_name_or_path: Union[str, os.PathLike], feature: str, opset: Optional[int] = None) -> 'ORTQuantizer'>
Clearly, from_pretrained here doesn't have a file_name parameter as has been indicated in the guide. Can someone please help me debug this error? Thanks!
Posting the solution I found while exploring optimum GitHub repo. The problem is that installing optimum via pip is downloading v1.3 which did not have the fix for quantizing seq2seq models. Instead install the package directly from GitHub using the command below. It worked fine afterwards.
python -m pip install git+https://github.com/huggingface/optimum.git

Caddy not working in api-platfrom 2.6.4 distribution - panic: proto: file "pb.proto" is already registered

When I try us api-platform version 2.6.4 I am not able to run it when i build adn strat containers and check logs caddy is not working i get an error like this. Any idea? Caddy version is 2.3.0
caddy_1 | panic: proto: file "pb.proto" is already registered
caddy_1 | See https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict
tureality_caddy_1 exited with code 2
Other people have reported having this bug and I had it too.
Fortunately, the bug as just been fixed by Dunglas itself. :)
https://github.com/api-platform/api-platform/issues/1881#issuecomment-822663193
The repair was done at the mercure level and not in the api platform source code itself so you can keep your current version.
You just have to docker-compose up and it will work.

i'm unable to get http-get response in OpenDayLight karaf console

as i'm new to this OpenDayLight, the following is my requirement
after installation of southbound plugin OVSDB in karaf console, i'm unable to get the http response from network-topology
installation is completely done by providing the following command in karaf console
feature:install odl-ovsdb-southbound-impl-ui
but after this installation,if i run the follow command
GET http://<controller-ip>:8181/restconf/config/network-topology:network-topology/topology/ovsdb:1/
or
GET http://<controller-ip>:8181/restconf/operational/network-topology:network-topology/topology/ovsdb:1
the result body should be:
{
"topology": [
{
"topology-id": "ovsdb:1"
}
]
}
but the result of my console is showing only
INFO
please give me any idea to get resultant output.
what ODL version are you using?
what tool are you using to issue the REST call?
I just tried with a very recent distribution (but I've known this to work
for a long time on much older versions as well):
opendaylight-user#root>feature:install odl-ovsdb-southbound-impl-ui
opendaylight-user#root>
then:
$ curl -u "admin:admin" http://127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/ovsdb:1
which gave me:
{"topology":[{"topology-id":"ovsdb:1"}]}

Minecraft 1.10.2 Forge Gradle error

So I'm trying to install the forge api (Minecraft 1.10.2) for developing a mod, and I'm having an issue with using ForgeGradle. Every time I run it with "bash gradlew setupDecompWorkspace", I get this error:
FAILURE: Build failed with an exception.
What went wrong:
Could not resolve all dependencies for configuration ':forgeGradleMcpData'.
Could not resolve de.oceanlabs.mcp:mcp:1.10.2.
Required by:
com.yourname.modid:forge-1:1.0
Could not resolve de.oceanlabs.mcp:mcp:1.10.2.
Could not get resource '(had to remove this link because too many links)'.
Could not GET '(had to remove this link because too many links)'.
org.apache.http.client.ClientProtocolException (no error message)
Could not resolve de.oceanlabs.mcp:mcp:1.10.2.
Could not get resource 'https://libraries.minecraft.net/de/oceanlabs/mcp/mcp/1.10.2/mcp-1.10.2.pom'.
Could not GET 'https://libraries.minecraft.net/de/oceanlabs/mcp/mcp/1.10.2/mcp-1.10.2.pom'. Received status code 403 from server: Forbidden
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I've found several people with the same issue, but they were posted back in (roughly) Minecraft 1.6-1.8. Does anyone have any idea about what I should do? I'm stumped and could use some help.
You need to set the mappings property in the minecraft closure in your build.gradle file so ForgeGradle knows which version of the MCP mappings to use.
For example, this will use the latest mappings (as of this posting):
minecraft {
mappings = "snapshot_20161002"
}
The snapshot mappings are built daily and the versions are in the form of snapshot_YYYYMMDD, you can see all the mappings versions here.
I had a similar issue with forge for 1.11. I couldn't use the latest mappings file for some reason. Keeping the mappings file at snapshot_29160518 worked for me.
See this commit for a 1.10.2 plugin build.gradle file:
https://github.com/ljsimin/MinecraftJoypadSplitscreenMod/commit/76b7c83bc35cbe11d6516b31f8e5e4f7ec74b99c

Grails 2.4.4 GGTS 3.6.3 not working in debug

bit more shinnangins
I have a project i'm trying to debug, using grails 2.4.4 and GGTS3.6.3
if run-app the project - works ok
when I try and set break point and the debug if get this error
|Loading Grails 2.4.4
Error |
There was an error loading the BuildConfig: argument type mismatch (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.IllegalArgumentException: argument type mismatch
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
at grails.util.BuildSettings.getForkConfig(BuildSettings.groovy:1515)
at grails.util.BuildSettings.establishProjectStructure(BuildSettings.groovy:1389)
at grails.util.BuildSettings.postLoadConfig(BuildSettings.groovy:1121)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1116)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1088)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1074)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy)
at grails.util.BuildSettings$loadConfig$0.callCurrent(Unknown Source)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1054)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
Error |
There was an error loading the BuildConfig: argument type mismatch
this looks like a repeat of this link on earlier version of grails
previous question
note says claimed fixed - but fails for me - any else got this issue
Brute force method. download fresh 'latest' copy of GGTS (I did 3.6.3-sr1). I then imported my project from previous workspace on 3.6.2 that i'd let get upgraded.
once imported into clean build and new workspace the problem seemed to go away.
I came across this same problem yesterday with ggts-3.4.0 and grails 2.4.3.
I can confirm that the -noreloading parameter has no effect.
I tried William's technique and implemented a clean install with ggts-3.6.4, alas to no avail.
In the end my solution/workaround is to leave one line of grails.project.fork uncommented out, namely:
test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true]
This allows me to both: run and debug my Application.
Allan.

Resources