ZennethKenneth commited on
Commit
2b5ab1c
·
verified ·
1 Parent(s): e703334

trust remote code

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -15,11 +15,12 @@ For more information on `huggingface_hub` Inference API support, please check th
15
  # requires space hardware update to use large models (TODO)
16
  # client = InferenceClient("mistralai/Mistral-Large-Instruct-2407")
17
  # Note change in instantiation***
18
- text_generator = pipeline("text-generation", model="microsoft/Phi-3-mini-4k-instruct", use_auth_token=hf_token)
 
19
 
20
  def authenticate_and_generate(token, message, history, system_message, max_tokens, temperature, top_p):
21
  # Initialize the text-generation pipeline with the provided token
22
- text_generator = pipeline("text-generation", model="google/gemma-2-2b", use_auth_token=token)
23
 
24
  # Construct the prompt with system message, history, and user input
25
  prompt = system_message + "\n" + "\n".join([f"User: {msg[0]}\nAssistant: {msg[1]}" for msg in history if msg[0] and msg[1]])
 
15
  # requires space hardware update to use large models (TODO)
16
  # client = InferenceClient("mistralai/Mistral-Large-Instruct-2407")
17
  # Note change in instantiation***
18
+ # pipeline move to func
19
+ # text_generator = pipeline("text-generation", model="microsoft/Phi-3-mini-4k-instruct", use_auth_token=hf_token, trust_remote_code=True)
20
 
21
  def authenticate_and_generate(token, message, history, system_message, max_tokens, temperature, top_p):
22
  # Initialize the text-generation pipeline with the provided token
23
+ text_generator = pipeline("text-generation", model="microsoft/Phi-3-mini-4k-instruct", use_auth_token=hf_token, trust_remote_code=True)
24
 
25
  # Construct the prompt with system message, history, and user input
26
  prompt = system_message + "\n" + "\n".join([f"User: {msg[0]}\nAssistant: {msg[1]}" for msg in history if msg[0] and msg[1]])