Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,15 @@
|
|
1 |
# app.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
import gradio as gr
|
3 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
4 |
|
|
|
5 |
# Load the model from Hugging Face Model Hub
|
6 |
model_name = "SamLowe/roberta-base-go_emotions"
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
|
1 |
# app.py
|
2 |
+
|
3 |
+
import subprocess
|
4 |
+
|
5 |
+
# Install dependencies
|
6 |
+
subprocess.run(["pip", "install", "-r", "requirements.txt"])
|
7 |
+
|
8 |
+
# Rest of your code
|
9 |
import gradio as gr
|
10 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
11 |
|
12 |
+
|
13 |
# Load the model from Hugging Face Model Hub
|
14 |
model_name = "SamLowe/roberta-base-go_emotions"
|
15 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|