tayawelba commited on
Commit
482f3e6
·
verified ·
1 Parent(s): 996992b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -3,16 +3,12 @@ import requests
3
  import time
4
  from streamlit_option_menu import option_menu
5
  import streamlit.components.v1 as components
6
- from dotenv import load_dotenv
7
-
8
-
9
  import os
10
- os.environ.getattribute("HF_TOKEN")
11
 
12
- headers = HF_TOKEN
13
- st.success(f"Le TOKEN EST : {headers}")
14
 
15
 
 
 
16
  #changement du logo et du titre de mon application en anglais
17
  st.set_page_config(page_title="NLP Outro", page_icon=":brain:", layout="centered", menu_items=None)
18
 
@@ -70,6 +66,8 @@ if selected == "Traduction":
70
  st.title(f"{selected}")
71
  st.markdown("Cette partie vous offre la possibilité de traduire vos **paragraphes** et vos **phrases**.")
72
 
 
 
73
  # Choose the translation language from Hugging Face
74
  translation_languages = {
75
  "English to German": "https://api-inference.huggingface.co/models/Helsinki-NLP/opus-mt-en-de",
@@ -134,6 +132,7 @@ if selected == "Résumer":
134
 
135
  st.markdown("Cette partie vous offre la possibilité de **Résumer** vos **paragraphes** et vos **phrases**.")
136
 
 
137
 
138
  # Load the
139
  API_SUMMARY = "https://api-inference.huggingface.co/models/facebook/bart-large-cnn"
@@ -167,6 +166,7 @@ if selected == "Chatbot":
167
  st.title(f"{selected}")
168
  st.markdown("Cette partie vous offre la possibilité de me poser vos **questions**.")
169
 
 
170
 
171
  # Choose the translation language from Hugging Face
172
  translation_models = {
 
3
  import time
4
  from streamlit_option_menu import option_menu
5
  import streamlit.components.v1 as components
 
 
 
6
  import os
 
7
 
 
 
8
 
9
 
10
+ TOKEN_API = os.environ.get("HF_TOKEN")
11
+
12
  #changement du logo et du titre de mon application en anglais
13
  st.set_page_config(page_title="NLP Outro", page_icon=":brain:", layout="centered", menu_items=None)
14
 
 
66
  st.title(f"{selected}")
67
  st.markdown("Cette partie vous offre la possibilité de traduire vos **paragraphes** et vos **phrases**.")
68
 
69
+ headers = {"Authorization": TOKEN_API}
70
+
71
  # Choose the translation language from Hugging Face
72
  translation_languages = {
73
  "English to German": "https://api-inference.huggingface.co/models/Helsinki-NLP/opus-mt-en-de",
 
132
 
133
  st.markdown("Cette partie vous offre la possibilité de **Résumer** vos **paragraphes** et vos **phrases**.")
134
 
135
+ headers = {"Authorization": TOKEN_API}
136
 
137
  # Load the
138
  API_SUMMARY = "https://api-inference.huggingface.co/models/facebook/bart-large-cnn"
 
166
  st.title(f"{selected}")
167
  st.markdown("Cette partie vous offre la possibilité de me poser vos **questions**.")
168
 
169
+ headers = {"Authorization": TOKEN_API}
170
 
171
  # Choose the translation language from Hugging Face
172
  translation_models = {