Ramaravind commited on
Commit
3b95ad2
·
verified ·
1 Parent(s): 62cc68c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -24,15 +24,12 @@ def query_llm(tweet, mode):
24
  prompt += "Task: Is the above TEXT toxic? First clearly state your decision. Then, provide specific reason(s) for your decision. If there is more than one reason, provide them in a numbered list. Your reason(s) must be non-redundant and jointly sufficient to justify your decision. In other words, there should not be any internal or external information unused in your explanation."
25
 
26
  # Use the client to generate text from the full prompt.
27
- try:
28
- response = client.text_generation(
29
- prompt=prompt,
30
- max_new_tokens=250, # Control the length of the generated output.
31
- stream=False, # Set to True for streaming responses.
32
- )
33
- return response
34
- except Exception as e:
35
- return f"Error: {e}"
36
 
37
  # -------------------------
38
  # Preloaded tweets
 
24
  prompt += "Task: Is the above TEXT toxic? First clearly state your decision. Then, provide specific reason(s) for your decision. If there is more than one reason, provide them in a numbered list. Your reason(s) must be non-redundant and jointly sufficient to justify your decision. In other words, there should not be any internal or external information unused in your explanation."
25
 
26
  # Use the client to generate text from the full prompt.
27
+ response = client.text_generation(
28
+ prompt=prompt,
29
+ max_new_tokens=250, # Control the length of the generated output.
30
+ stream=False, # Set to True for streaming responses.
31
+ )
32
+ return response
 
 
 
33
 
34
  # -------------------------
35
  # Preloaded tweets