Arhashmi commited on
Commit
8f180e3
1 Parent(s): f9577cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -1,13 +1,20 @@
1
  import os
2
  from typing import Iterator
3
  import gradio as gr
4
- from text_generation import Client
 
 
 
 
5
 
6
- os.environ['HF_READ_TOKEN'] = "your_actual_token_here"
7
  HF_TOKEN = os.environ.get('HF_READ_TOKEN', False)
8
  EOS_STRING = '</s>'
9
  EOT_STRING = '<EOT>'
10
 
 
 
 
 
11
  def get_prompt(message, chat_history, system_prompt):
12
  texts = [f'<s>[INST] <<SYS>>\n{system_prompt}\n<</SYS>>\n\n']
13
 
 
1
  import os
2
  from typing import Iterator
3
  import gradio as gr
4
+ from text_generation import Client # Assuming you have a text_generation module
5
+ from transformers import AutoModel
6
+
7
+ # Set Hugging Face API token
8
+ os.environ['HF_READ_TOKEN'] = "your_actual_token_here" # Replace with your Hugging Face API token
9
 
 
10
  HF_TOKEN = os.environ.get('HF_READ_TOKEN', False)
11
  EOS_STRING = '</s>'
12
  EOT_STRING = '<EOT>'
13
 
14
+ # Load the private model with access token
15
+ access_token = "hf_..." # Replace with your actual access token
16
+ model = AutoModel.from_pretrained("private/model", token=access_token)
17
+
18
  def get_prompt(message, chat_history, system_prompt):
19
  texts = [f'<s>[INST] <<SYS>>\n{system_prompt}\n<</SYS>>\n\n']
20