barbieheimer commited on
Commit
2a1aa66
1 Parent(s): 6a8d218

Update app.py

Browse files

pls work omgggg ahhhhhhh

Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -1,7 +1,14 @@
1
  # here are some examples for sadness, joy, anger, and optimism.
2
  import gradio as gr
 
 
 
3
 
4
- model = "models/barbieheimer/MND_TweetEvalBert_model"
 
 
 
 
5
 
6
  def predict(prompt):
7
  completion = classifier(prompt)
 
1
  # here are some examples for sadness, joy, anger, and optimism.
2
  import gradio as gr
3
+ # Load model directly
4
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
5
+ from transformers import pipeline
6
 
7
+ tokenizer = AutoTokenizer.from_pretrained("barbieheimer/MND_TweetEvalBert_model")
8
+ model = AutoModelForSequenceClassification.from_pretrained("barbieheimer/MND_TweetEvalBert_model")
9
+
10
+ # We can now use the model in the pipeline.
11
+ classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
12
 
13
  def predict(prompt):
14
  completion = classifier(prompt)