Spaces:
Runtime error
Runtime error
MariyaBenny
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,13 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification
|
3 |
|
4 |
-
# Load tokenizer and model from Hugging Face model hub
|
5 |
model_name = "hiieu/Meta-Llama-3-8B-Instruct-function-calling-json-mode"
|
6 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
7 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
8 |
|
9 |
-
# Define the pipeline using the loaded tokenizer and model
|
10 |
pipe = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
|
11 |
text = st.text_area("Enter your text:")
|
12 |
|
13 |
if text:
|
14 |
-
# Perform sentiment analysis using the pipeline
|
15 |
out = pipe(text)
|
16 |
st.json(out)
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification
|
3 |
|
|
|
4 |
model_name = "hiieu/Meta-Llama-3-8B-Instruct-function-calling-json-mode"
|
5 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
6 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
7 |
|
|
|
8 |
pipe = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
|
9 |
text = st.text_area("Enter your text:")
|
10 |
|
11 |
if text:
|
|
|
12 |
out = pipe(text)
|
13 |
st.json(out)
|