XY26 commited on
Commit
d13ada5
·
verified ·
1 Parent(s): f4533e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -12,7 +12,8 @@ model_path = hf_hub_download(
12
  llm = Llama(
13
  model_path=model_path,
14
  n_ctx=2048,
15
- n_threads=2
 
16
  )
17
 
18
  def dual_frame_response(message, history):
@@ -21,9 +22,9 @@ def dual_frame_response(message, history):
21
  1. **The Gain Frame (Positive)**
22
  2. **The Loss Frame (Negative)**
23
  Do not offer a synthesis."""
24
-
25
  prompt = f"<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\n{system_prompt}<|eot_id|><|start_header_id|>user<|end_header_id|>\n\n{message}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"
26
-
27
  output = llm(
28
  prompt,
29
  max_tokens=512,
@@ -36,7 +37,7 @@ demo = gr.ChatInterface(
36
  fn=dual_frame_response,
37
  title="🤖 Unbiased Framing Decision Architect",
38
  description="Running Llama 3.1 on Hugging Face Free Tier.",
39
- examples=["Should I buy a lottery ticket?", "Is nuclear energy good?", "Surgery 95% success rate."],
40
  )
41
 
42
  if __name__ == "__main__":
 
12
  llm = Llama(
13
  model_path=model_path,
14
  n_ctx=2048,
15
+ n_threads=2,
16
+ verbose=False
17
  )
18
 
19
  def dual_frame_response(message, history):
 
22
  1. **The Gain Frame (Positive)**
23
  2. **The Loss Frame (Negative)**
24
  Do not offer a synthesis."""
25
+
26
  prompt = f"<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\n{system_prompt}<|eot_id|><|start_header_id|>user<|end_header_id|>\n\n{message}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"
27
+
28
  output = llm(
29
  prompt,
30
  max_tokens=512,
 
37
  fn=dual_frame_response,
38
  title="🤖 Unbiased Framing Decision Architect",
39
  description="Running Llama 3.1 on Hugging Face Free Tier.",
40
+ examples=["Should I buy a lottery ticket?", "Is nuclear energy good?"],
41
  )
42
 
43
  if __name__ == "__main__":