Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,23 +1,20 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
|
|
3 |
|
4 |
-
|
5 |
-
|
|
|
6 |
|
7 |
-
|
8 |
-
st.title("Fake News Detector")
|
9 |
|
10 |
-
|
11 |
-
|
|
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
|
19 |
-
# Display result
|
20 |
-
st.subheader("Result:")
|
21 |
-
st.write(f"Label: {result['label']}, Confidence: {result['score']:.2f}")
|
22 |
-
else:
|
23 |
-
st.warning("Please enter a news article for analysis.")
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
+
pipe = pipeline('text-generation', model='Pclanglais/MonadGPT', device='cuda')
|
4 |
|
5 |
+
def main():
|
6 |
+
st.title("MonadGPT Streamlit App")
|
7 |
+
st.markdown("This is a streamlit app that allows you to have a conversation abbout any topic")
|
8 |
|
9 |
+
user_input = st.text_input("Your question:")
|
|
|
10 |
|
11 |
+
if user_input:
|
12 |
+
response = pipe(user_input, max_length=256, do_sample=True, top_k=50, top_p=0.95, early_stopping=True)
|
13 |
+
st.write(response[0]['generated_text'])
|
14 |
|
15 |
+
if st.button("Restart"):
|
16 |
+
st.empty()
|
17 |
+
|
18 |
+
if __name__ == "__main__":
|
19 |
+
main()
|
20 |
|
|
|
|
|
|
|
|
|
|