Spaces:
Sleeping
Sleeping
Florian.Moret
commited on
Commit
·
1024e7a
1
Parent(s):
b0f391f
test_app
Browse files
app.py
CHANGED
@@ -1,24 +1,30 @@
|
|
1 |
-
#test app code de chatgpt
|
2 |
import streamlit as st
|
3 |
-
from transformers import pipeline
|
4 |
|
5 |
-
|
6 |
-
|
7 |
|
8 |
-
#
|
9 |
-
|
10 |
-
|
11 |
-
return response[0]['generated_text']
|
12 |
|
13 |
-
#
|
14 |
-
|
15 |
|
16 |
-
#
|
17 |
-
|
|
|
|
|
18 |
|
19 |
-
#
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
-
if user_input:
|
23 |
-
response = chatbot_response(user_input)
|
24 |
-
st.write(f"Chatbot : {response}")
|
|
|
|
|
1 |
import streamlit as st
|
|
|
2 |
|
3 |
+
x = st.slider('Select a value')
|
4 |
+
st.write(x, 'squared is', x * x)
|
5 |
|
6 |
+
# #test app code de chatgpt
|
7 |
+
# import streamlit as st
|
8 |
+
# from transformers import pipeline
|
|
|
9 |
|
10 |
+
# # Chargement du modèle Hugging Face (GPT-2 ou autre modèle de génération de texte)
|
11 |
+
# generator = pipeline('text-generation', model='gpt2')
|
12 |
|
13 |
+
# # Fonction pour générer une réponse du chatbot
|
14 |
+
# def chatbot_response(user_input):
|
15 |
+
# response = generator(user_input, max_length=100, num_return_sequences=1)
|
16 |
+
# return response[0]['generated_text']
|
17 |
|
18 |
+
# # Interface Streamlit
|
19 |
+
# st.title("Chatbot Hugging Face")
|
20 |
+
|
21 |
+
# # Instructions
|
22 |
+
# st.markdown("### Posez une question et le chatbot vous répondra !")
|
23 |
+
|
24 |
+
# # Entrée utilisateur
|
25 |
+
# user_input = st.text_input("Vous :")
|
26 |
+
|
27 |
+
# if user_input:
|
28 |
+
# response = chatbot_response(user_input)
|
29 |
+
# st.write(f"Chatbot : {response}")
|
30 |
|
|
|
|
|
|