Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,14 @@
|
|
1 |
#!pip install -q transformers datasets torch gradio console_logging numpy
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
import gradio as gr
|
4 |
|
5 |
title = 'Text market sentiment'
|
@@ -8,21 +17,15 @@ model = torch.load("huggingface/Berbex/Model")
|
|
8 |
|
9 |
inp = [gr.Textbox(label='API Key', placeholder="What is your API Key?"), gr.Textbox(label='Audio File URL', placeholder="Audio file URL?")]
|
10 |
out = gr.Textbox(label='Output')
|
|
|
|
|
11 |
|
12 |
interface = gr.Interface.load(input=inp,output=out,
|
13 |
title = title,
|
14 |
theme = "peach",
|
15 |
examples = [[text_]]).launch()
|
16 |
|
17 |
-
|
18 |
-
from datasets import load_dataset
|
19 |
-
from console_logging.console import Console
|
20 |
-
import numpy as np
|
21 |
-
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
22 |
-
from transformers import TrainingArguments, Trainer
|
23 |
-
from sklearn.metrics import f1_score, roc_auc_score, accuracy_score
|
24 |
-
from transformers import EvalPrediction
|
25 |
-
import torch
|
26 |
console = Console()
|
27 |
|
28 |
dataset = load_dataset("zeroshot/twitter-financial-news-sentiment", )
|
|
|
1 |
#!pip install -q transformers datasets torch gradio console_logging numpy
|
2 |
|
3 |
+
import torch
|
4 |
+
from datasets import load_dataset
|
5 |
+
from console_logging.console import Console
|
6 |
+
import numpy as np
|
7 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
8 |
+
from transformers import TrainingArguments, Trainer
|
9 |
+
from sklearn.metrics import f1_score, roc_auc_score, accuracy_score
|
10 |
+
from transformers import EvalPrediction
|
11 |
+
import torch
|
12 |
import gradio as gr
|
13 |
|
14 |
title = 'Text market sentiment'
|
|
|
17 |
|
18 |
inp = [gr.Textbox(label='API Key', placeholder="What is your API Key?"), gr.Textbox(label='Audio File URL', placeholder="Audio file URL?")]
|
19 |
out = gr.Textbox(label='Output')
|
20 |
+
text_button = gr.Button("Flip")
|
21 |
+
text_button.click(audio_to_text, inputs=inp, outputs=out)
|
22 |
|
23 |
interface = gr.Interface.load(input=inp,output=out,
|
24 |
title = title,
|
25 |
theme = "peach",
|
26 |
examples = [[text_]]).launch()
|
27 |
|
28 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
console = Console()
|
30 |
|
31 |
dataset = load_dataset("zeroshot/twitter-financial-news-sentiment", )
|