qwenzoo commited on
Commit
64a1a90
1 Parent(s): 6421806

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +21 -1
README.md CHANGED
@@ -41,7 +41,27 @@ A fine-tuned Galactica model to detect machine-generated scientific papers based
41
 
42
  ### Direct Use
43
 
44
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
  [More Information Needed]
47
 
 
41
 
42
  ### Direct Use
43
 
44
+ ```{python}
45
+ from transformers import AutoTokenizer, OPTForSequenceClassification, pipeline
46
+
47
+ model = OPTForSequenceClassification.from_pretrained("tum-nlp/IDMGSP-Galactica-TRAIN")
48
+
49
+ tokenizer = AutoTokenizer.from_pretrained("tum-nlp/IDMGSP")
50
+
51
+ reader = pipeline("text-classification", model=model, tokenizer = tokenizer)
52
+
53
+ reader(
54
+ '''
55
+ Abstract:
56
+ ....
57
+
58
+ Introduction:
59
+ ....
60
+
61
+ Conclusion:
62
+ ...'''
63
+ )
64
+ ```
65
 
66
  [More Information Needed]
67