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

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

Related

Unable to load dynamic library 'blackfire'

I create a post today because I have a problem with the blackfire installation.
I read all documentation and install this extension but I have an error message in my command consol.
I did add BlackFire but when I want to config the extension, this message appair :
Warning: PHP Startup: Unable to load dynamic library 'blackfire' (tried: D:/Programmes/WAMP/bin/php/php7.3.12/ext/blackfire (The specified module was not found.), D:/Programmes/WAMP/bin/php/php7.3.12/ext/php_blackfire.dll (The specified module was not found.)) in Unknown on line 0[enter image description here]
I'm sure as a good path and I don't understand why I have this message..
If you can help me,
Thanks in advance and good development !

'rasa shell' giving error after successful execution of 'rasa train'

I have trained the rasa model and when I do rasa shell it shows
2020-04-04 11:57:26 ERROR rasa.core.actions.action - Couldn't create message for template 'utter_greet'.
this error. And for actions it is showing
2020-04-04 11:58:27 ERROR rasa_sdk.endpoint - Failed to extract slot job_function with action sales_form
this error.
Please help me in fixing this error. Any help will be highly appreciated.
This issue got fixed when I replaced 'templates' with 'responses' in domain.yml file. I am using rasa 2.0 version. This should work from rasa version 1.7 onwards

Data Explorer: ImportError No module named Kqlmagic

I'm following this tutorial:
https://learn.microsoft.com/en-us/azure/data-explorer/kqlmagic
I have a Databricks cluster so I decided to use the notebook that is available on there.
When I get to step 2 and run:
reload_ext Kqlmagic
I get the error message:
ImportError: No module named Kqlmagic
Kqlmagic doesn't work with Databricks notebook. It might be supported in a future version.
Please try running instead of Steps 1,2:
%load_ext Kqlmagic

Error on installing Titan DB on Windows

Following the official guide of Titan DB here, and trying to run the command:
graph = TitanFactory.open('conf/titan-cassandra-es.properties')
I got this error:
Backend shorthand unknown: conf/titan-cassandra-es.properties
Obviously, the reason is the incorrect path to the
titan-cassandra-es.properties
file. So I changed it to:
graph = TitanFactory.open('../conf/titan-cassandra-es.properties')
and got this error:
Encountered unregistered class ID: 141.
The error happens in the following version:
titan-0.5.4-hadoop2
On titan-1.0.0-hadoop2 instead of this error message I get this one:
Invalid import definition: 'com.thinkaurelius.titan.hadoop.MapReduceIndexManagement'; reason: startup failed: script14747941661821834264593.groovy: 1: unable to resolve class com.thinkaurelius.titan.hadoop.MapReduceIndexManagement # line 1, column 1. import com.thinkaurelius.titan.hadoop.MapReduceIndexManagement ^
1 error
And on titan-1.0.0-hadoop2 I get this one:
The input line is too long.
The syntax of the command is incorrect.
Does anyone know how to handle this issue?
It seems like you have not even managed to get Titan 1 to start up yet.
I do not believe Titan 1 has been deployed to support Windows out of the box. I.e. the downloadable package will not just work with windows.
Saying that I have managed to get Titan DB 1 to work on windows. To do so, all you have to do is install Cassandra 2.x on Windows. This guide may help you out. Start cassandra and enable thrift connections.
With that done you should be able to get Titan doing basic operations on windows. From there you may find dealing with you current errors easier.
Side Note: Windows support for Titan 0.5.x may be more substantial. So you could look into that as well.

Facing issues with using Openpgp library

I downloaded the OpenPGP example code mentioned in question How do you use the PHP OpenPGP library?.
I faced following error when I tried to access keygen.php:
Fatal error: Call to undefined method OpenPGP_Message::signature_and_data() in D:\official\data\sites\openpgp\lib\openpgp_crypt_rsa.php on line 145
Infact, none of three is working. Can you please explain how to fix these issues?
I guess that line 148 in https://github.com/singpolyma/openpgp-php/blob/master/lib/openpgp_crypt_rsa.php
must be corrected from:
$sig = $packet->signature_and_data();
to:
$sig = $packet->signatures();

Resources