Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,12 @@
|
|
| 1 |
import os
|
| 2 |
import streamlit as st
|
| 3 |
from transformers import pipeline
|
|
|
|
| 4 |
from huggingface_hub.inference_api import InferenceApi
|
| 5 |
|
|
|
|
|
|
|
|
|
|
| 6 |
pipe = pipeline("sentiment-analysis")
|
| 7 |
text1 = st.text_area("enter some text 111")
|
| 8 |
|
|
@@ -14,6 +18,7 @@ API_TOKEN = os.getenv('My_Token')
|
|
| 14 |
|
| 15 |
inference = InferenceApi(repo_id="bert-base-uncased", token=API_TOKEN)
|
| 16 |
|
|
|
|
| 17 |
text2 = st.text_area("enter some text 222")
|
| 18 |
if text2:
|
| 19 |
res = inference(inputs=text2)
|
|
|
|
| 1 |
import os
|
| 2 |
import streamlit as st
|
| 3 |
from transformers import pipeline
|
| 4 |
+
from datasets import load_dataset
|
| 5 |
from huggingface_hub.inference_api import InferenceApi
|
| 6 |
|
| 7 |
+
dataset = load_dataset("merve/poetry", streaming=True)
|
| 8 |
+
df = pd.DataFrame.from_dict(dataset["train"])
|
| 9 |
+
|
| 10 |
pipe = pipeline("sentiment-analysis")
|
| 11 |
text1 = st.text_area("enter some text 111")
|
| 12 |
|
|
|
|
| 18 |
|
| 19 |
inference = InferenceApi(repo_id="bert-base-uncased", token=API_TOKEN)
|
| 20 |
|
| 21 |
+
# The goal of life is [MASK]
|
| 22 |
text2 = st.text_area("enter some text 222")
|
| 23 |
if text2:
|
| 24 |
res = inference(inputs=text2)
|