macc2692 commited on
Commit
ea60921
1 Parent(s): b78812a

Added access token

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import spaces
2
  import torch
 
3
  from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer
4
  import gradio as gr
5
  from threading import Thread
@@ -13,6 +14,9 @@ theme = gr.themes.Base(
13
  font=[gr.themes.GoogleFont('Libre Franklin'), gr.themes.GoogleFont('Public Sans'), 'system-ui', 'sans-serif'],
14
  )
15
 
 
 
 
16
  tokenizer = AutoTokenizer.from_pretrained("Writer/Palmyra-Fin-70B-32K")
17
  model = AutoModelForCausalLM.from_pretrained("Writer/Palmyra-Fin-70B-32K")
18
  #tokenizer = AutoTokenizer.from_pretrained("yam-peleg/Experiment26-7B", trust_remote_code=True)
 
1
  import spaces
2
  import torch
3
+ import os
4
  from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer
5
  import gradio as gr
6
  from threading import Thread
 
14
  font=[gr.themes.GoogleFont('Libre Franklin'), gr.themes.GoogleFont('Public Sans'), 'system-ui', 'sans-serif'],
15
  )
16
 
17
+ from huggingface_hub import login
18
+ login(token=os.getenv('ACCESS_TOKEN'))
19
+
20
  tokenizer = AutoTokenizer.from_pretrained("Writer/Palmyra-Fin-70B-32K")
21
  model = AutoModelForCausalLM.from_pretrained("Writer/Palmyra-Fin-70B-32K")
22
  #tokenizer = AutoTokenizer.from_pretrained("yam-peleg/Experiment26-7B", trust_remote_code=True)