Spaces:
Runtime error
Runtime error
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -1,16 +1,12 @@
|
|
| 1 |
-
import
|
| 2 |
-
from transformers import pipeline
|
| 3 |
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
|
| 10 |
-
if user_input:
|
| 11 |
-
result = sentiment_pipeline(user_input)
|
| 12 |
-
sentiment = result[0]["label"]
|
| 13 |
-
confidence = result[0]["score"]
|
| 14 |
-
|
| 15 |
-
st.write(f"Sentiment: {sentiment}")
|
| 16 |
-
st.write(f"Confidence: {confidence:.2f}")
|
|
|
|
| 1 |
+
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
+
def greet(name, intensity):
|
| 4 |
+
return "Hello " * intensity + name + "!"
|
| 5 |
|
| 6 |
+
demo = gr.Interface(
|
| 7 |
+
fn=greet,
|
| 8 |
+
inputs=["text", "slider"],
|
| 9 |
+
outputs=["text"],
|
| 10 |
+
)
|
| 11 |
|
| 12 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|