Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
from transformers import pipeline
|
3 |
-
|
4 |
-
model = pipeline("tiiuae/falcon-7b-instruct")
|
5 |
-
|
6 |
-
def main():
|
7 |
-
st.title("Hugging Face Model Demo")
|
8 |
-
|
9 |
-
# Create an input text box
|
10 |
-
input_text = st.text_input("Enter your text", "")
|
11 |
-
|
12 |
-
# Create a button to trigger model inference
|
13 |
-
if st.button("Analyze"):
|
14 |
-
# Perform inference using the loaded model
|
15 |
-
result = model(input_text)
|
16 |
-
st.write("Prediction:", result[0]['label'], "| Score:", result[0]['score'])
|
17 |
-
|
18 |
-
if __name__ == "__main__":
|
19 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|