fiesty-bear commited on
Commit
05a2e79
·
1 Parent(s): dc65a0f

added HF_TOKEN

Browse files
Files changed (2) hide show
  1. app.py +3 -1
  2. requirements.txt +1 -1
app.py CHANGED
@@ -1,8 +1,10 @@
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
 
4
  # Use a pipeline as a high-level helper
5
- pipe = pipeline("text-generation", model="meta-llama/Llama-2-7b-chat-hf")
6
 
7
  def llama_chat(name):
8
  resp = pipe(name)
 
1
+ import os
2
  import gradio as gr
3
  from transformers import pipeline
4
 
5
+ token = os.environ.get('HF_TOKEN')
6
  # Use a pipeline as a high-level helper
7
+ pipe = pipeline("text-generation", model="meta-llama/Llama-2-7b-chat-hf", token=token)
8
 
9
  def llama_chat(name):
10
  resp = pipe(name)
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
  gradio
2
- transformers
 
1
  gradio
2
+ transformers