Spaces:
Build error
Build error
Commit ·
cc156dc
1
Parent(s): c807b76
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
| 4 |
from datasets import load_dataset
|
| 5 |
imdb = load_dataset("imdb")
|
| 6 |
|
|
@@ -23,7 +22,7 @@ training_args = TrainingArguments(
|
|
| 23 |
learning_rate=2e-5,
|
| 24 |
per_device_train_batch_size=16,
|
| 25 |
per_device_eval_batch_size=16,
|
| 26 |
-
num_train_epochs=
|
| 27 |
weight_decay=0.01,
|
| 28 |
)
|
| 29 |
|
|
@@ -42,6 +41,6 @@ def greet(text):
|
|
| 42 |
pipe = pipeline("sentiment-analysis", tokenizer=tokenizer, model=model)
|
| 43 |
return pipe(text)[0]['label']
|
| 44 |
|
| 45 |
-
iface = gr.Interface(fn=greet, inputs=gr.inputs.Textbox(placeholder="
|
| 46 |
|
| 47 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
|
|
|
| 3 |
from datasets import load_dataset
|
| 4 |
imdb = load_dataset("imdb")
|
| 5 |
|
|
|
|
| 22 |
learning_rate=2e-5,
|
| 23 |
per_device_train_batch_size=16,
|
| 24 |
per_device_eval_batch_size=16,
|
| 25 |
+
num_train_epochs=5,
|
| 26 |
weight_decay=0.01,
|
| 27 |
)
|
| 28 |
|
|
|
|
| 41 |
pipe = pipeline("sentiment-analysis", tokenizer=tokenizer, model=model)
|
| 42 |
return pipe(text)[0]['label']
|
| 43 |
|
| 44 |
+
iface = gr.Interface(fn=greet, inputs=gr.inputs.Textbox(placeholder="Please enter the sentence...", lines=5), outputs="text")
|
| 45 |
|
| 46 |
iface.launch()
|