sachitksh123 commited on
Commit
60ef490
·
verified ·
1 Parent(s): 1bc6f6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import streamlit as st
2
  import requests
3
  from transformers import pipeline
 
4
  import urllib3
5
 
6
  # Disable warnings
@@ -10,8 +11,12 @@ urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
10
  session = requests.Session()
11
  session.verify = False # Disable SSL verification
12
 
13
- # Set up the text generation pipeline
14
- pipe = pipeline("text-generation", model="meta-llama/Llama-3.1-8B-Instruct", use_auth_token=True, request_session=session)
 
 
 
 
15
 
16
  # Streamlit application
17
  st.title("Text Generation with Hugging Face")
 
1
  import streamlit as st
2
  import requests
3
  from transformers import pipeline
4
+ import os
5
  import urllib3
6
 
7
  # Disable warnings
 
11
  session = requests.Session()
12
  session.verify = False # Disable SSL verification
13
 
14
+ # Load the token from an environment variable
15
+
16
+
17
+ # Set up the text generation pipeline with the token
18
+ pipe = pipeline("text-generation", model="meta-llama/Llama-3.1-8B-Instruct",
19
+ use_auth_token=HUGGINGFACE_TOKEN, request_session=session)
20
 
21
  # Streamlit application
22
  st.title("Text Generation with Hugging Face")