Namitg02 commited on
Commit
e9b987a
·
verified ·
1 Parent(s): 56253bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -81,8 +81,25 @@ print("check2")
81
  print("result")
82
 
83
  print("check3")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  #chain = pipe(question = question,context = "Use the following information to answer the question. {context}.")
85
- chain = pipe(question = question,context = "Use the following information to answer the question. Diabetes can be cured by eating apples.")
86
  #context = "Use the following information to answer the question. Diabetes can be cured by eating apples."
87
 
88
  print("check3A")
 
81
  print("result")
82
 
83
  print("check3")
84
+
85
+ messages = [
86
+ {
87
+ "role": "system",
88
+ "content": "You are a friendly chatbot who responds in the style of a doctor",
89
+ },
90
+ {"role": "user", "content": "How can I reverse diabetes?"},
91
+ ]
92
+ prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
93
+ chain = pipe(prompt, max_new_tokens=256, do_sample=True)
94
+ print(chain[0]["generated_text"])
95
+
96
+ #chain = pipe(question = question,context = "Use the following information to answer the question. Diabetes can be cured by eating apples.")
97
+
98
+
99
+
100
+
101
+
102
  #chain = pipe(question = question,context = "Use the following information to answer the question. {context}.")
 
103
  #context = "Use the following information to answer the question. Diabetes can be cured by eating apples."
104
 
105
  print("check3A")