ysharma HF staff commited on
Commit
6f32c6f
1 Parent(s): 42b930d

logging info

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -13,8 +13,8 @@ system_message = "\nYou are a helpful, respectful and honest assistant. Always a
13
 
14
  def predict(message, chatbot):
15
 
16
- print(f"message is - {message}")
17
- print(f"chatbot is - {chatbot}")
18
 
19
  input_prompt = f"[INST]<<SYS>>\n{system_message}\n<</SYS>>\n\n "
20
  for interaction in chatbot:
@@ -22,7 +22,7 @@ def predict(message, chatbot):
22
 
23
  input_prompt = input_prompt + message + " [/INST] "
24
 
25
- print(f"input_prompt is - {input_prompt}")
26
  data = {
27
  "inputs": input_prompt,
28
  "parameters": {"max_new_tokens":100}
@@ -30,7 +30,7 @@ def predict(message, chatbot):
30
 
31
  response = requests.post(api_url, headers=headers, data=json.dumps(data), auth=('hf', hf_token))
32
 
33
- print(f'API response is - {response.text}')
34
  response_json_object = json.loads(response.text)
35
  return response_json_object[0]['generated_text']
36
 
 
13
 
14
  def predict(message, chatbot):
15
 
16
+ print(f"Logging: message is - {message}")
17
+ print(f"Logging: chatbot is - {chatbot}")
18
 
19
  input_prompt = f"[INST]<<SYS>>\n{system_message}\n<</SYS>>\n\n "
20
  for interaction in chatbot:
 
22
 
23
  input_prompt = input_prompt + message + " [/INST] "
24
 
25
+ print(f"Logging: input_prompt is - {input_prompt}")
26
  data = {
27
  "inputs": input_prompt,
28
  "parameters": {"max_new_tokens":100}
 
30
 
31
  response = requests.post(api_url, headers=headers, data=json.dumps(data), auth=('hf', hf_token))
32
 
33
+ print(f'Logging: API response is - {response.text}')
34
  response_json_object = json.loads(response.text)
35
  return response_json_object[0]['generated_text']
36