Spaces:
Sleeping
Sleeping
Add About and Main pages to Streamlit app; update requirements
Browse files- app.py +8 -8
- pages/About.py +4 -0
- pages/Analysis +15 -0
- pages/Main.py +4 -0
- requirements.txt +2 -2
app.py
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
import transformers
|
| 3 |
-
from transformers import pipeline
|
| 4 |
|
| 5 |
st.title('My first app')
|
| 6 |
x = st.slider('Select a value')
|
| 7 |
st.write(x, 'squared is', x * x)
|
| 8 |
|
| 9 |
-
classifier = pipeline("text-classification", model="distilbert-base-uncased-finetuned-sst-2-english")
|
| 10 |
|
| 11 |
-
# Example input text
|
| 12 |
-
input_text = "I love using Hugging Face models!"
|
| 13 |
|
| 14 |
-
# Get the classification result
|
| 15 |
-
result = classifier(input_text)
|
| 16 |
-
st.write(result)
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
#import transformers
|
| 3 |
+
#from transformers import pipeline
|
| 4 |
|
| 5 |
st.title('My first app')
|
| 6 |
x = st.slider('Select a value')
|
| 7 |
st.write(x, 'squared is', x * x)
|
| 8 |
|
| 9 |
+
# classifier = pipeline("text-classification", model="distilbert-base-uncased-finetuned-sst-2-english")
|
| 10 |
|
| 11 |
+
# # Example input text
|
| 12 |
+
# input_text = "I love using Hugging Face models!"
|
| 13 |
|
| 14 |
+
# # Get the classification result
|
| 15 |
+
# result = classifier(input_text)
|
| 16 |
+
# st.write(result)
|
pages/About.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
st.title('About')
|
| 4 |
+
st.write('This app performs text analysis using Hugging Face transformers.')
|
pages/Analysis
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
#import transformers
|
| 3 |
+
#from transformers import pipeline
|
| 4 |
+
|
| 5 |
+
st.title('Text Analysis')
|
| 6 |
+
|
| 7 |
+
# classifier = pipeline("text-classification", model="distilbert-base-uncased-finetuned-sst-2-english")
|
| 8 |
+
|
| 9 |
+
# input_text = st.text_area("Enter text to analyze:")
|
| 10 |
+
# if st.button('Analyze'):
|
| 11 |
+
# if input_text:
|
| 12 |
+
# result = classifier(input_text)
|
| 13 |
+
# st.write(result)
|
| 14 |
+
# else:
|
| 15 |
+
# st.warning('Please enter some text')
|
pages/Main.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
st.title('Welcome to Text Analysis App')
|
| 4 |
+
st.write('Use the sidebar to navigate between pages')
|
requirements.txt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
streamlit
|
| 2 |
-
transformers
|
| 3 |
-
torch
|
|
|
|
| 1 |
streamlit
|
| 2 |
+
#transformers
|
| 3 |
+
#torch
|