SLPG commited on
Commit
2f974f3
·
verified ·
1 Parent(s): fb2e6b2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -8
README.md CHANGED
@@ -23,14 +23,35 @@ library_name: transformers
23
 
24
  </div>
25
 
26
- ## Use this Model
27
- # Load model directly
28
- from transformers import AutoModel
29
- model = AutoModel.from_pretrained("SLPG/Biomedical_French_to_English")
30
- # Use a pipeline as a high-level helper
31
- from transformers import pipeline
32
-
33
- pipe = pipeline("translation", model="SLPG/Biomedical_French_to_English")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  ## Citation
36
 
 
23
 
24
  </div>
25
 
26
+ ## How to use this Model?
27
+ * This model can be accessed via git clone:
28
+ ```
29
+ git clone https://huggingface.co/SLPG/Biomedical_French_to_English
30
+ ```
31
+ * You can use Fairseq library to access the model for translations:
32
+ ```
33
+ from fairseq.models.transformer import TransformerModel
34
+ ```
35
+
36
+ ### Load the model
37
+ ```
38
+ model = TransformerModel.from_pretrained('path/to/model')
39
+
40
+ ```
41
+
42
+ #### Set the model to evaluation mode
43
+ ```
44
+ model.eval()
45
+ ```
46
+
47
+ #### Perform inference
48
+ ```
49
+ input_text = 'Hello, how are you?'
50
+
51
+ output_text = model.translate(input_text)
52
+
53
+ print(output_text)
54
+ ```
55
 
56
  ## Citation
57