trying again
Browse files
app.py
CHANGED
@@ -22,8 +22,9 @@ def summarize_text(text):
|
|
22 |
return stext
|
23 |
|
24 |
##Fiscal Sentiment
|
25 |
-
fin_model = pipeline("text-classification", model="demo-org/auditor_review_model", \
|
26 |
-
tokenizer="demo-org/auditor_review_model",use_auth_token=auth_token)
|
|
|
27 |
def text_to_sentiment(text):
|
28 |
sentiment = fin_model(text)[0]["label"]
|
29 |
return sentiment
|
@@ -63,7 +64,7 @@ with demo:
|
|
63 |
|
64 |
audio_file = gr.inputs.Audio(source="microphone", type="filepath")
|
65 |
b1 = gr.Button("Recognize Speech")
|
66 |
-
text = gr.Textbox()
|
67 |
b1.click(speech_to_text, inputs=audio_file, outputs=text)
|
68 |
|
69 |
b2 = gr.Button("Summarize Text")
|
|
|
22 |
return stext
|
23 |
|
24 |
##Fiscal Sentiment
|
25 |
+
#fin_model = pipeline("text-classification", model="demo-org/auditor_review_model", \
|
26 |
+
# tokenizer="demo-org/auditor_review_model",use_auth_token=auth_token)
|
27 |
+
fin_model = pipeline("text-classification")
|
28 |
def text_to_sentiment(text):
|
29 |
sentiment = fin_model(text)[0]["label"]
|
30 |
return sentiment
|
|
|
64 |
|
65 |
audio_file = gr.inputs.Audio(source="microphone", type="filepath")
|
66 |
b1 = gr.Button("Recognize Speech")
|
67 |
+
text = gr.Textbox(value="US retail sales fell in May for the first time in five months, restrained by a plunge in auto purchases and other big-ticket items, suggesting moderating demand for goods amid decades-high inflation. The value of overall retail purchases decreased 0.3%, after a downwardly revised 0.7% gain in April, Commerce Department figures showed Wednesday. Excluding vehicles, sales rose 0.5% last month. The figures aren’t adjusted for inflation.")
|
68 |
b1.click(speech_to_text, inputs=audio_file, outputs=text)
|
69 |
|
70 |
b2 = gr.Button("Summarize Text")
|