alisamak commited on
Commit
3cb9cbb
·
verified ·
1 Parent(s): 9433515
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -12,6 +12,9 @@ from Gradio_UI import GradioUI
12
  TELEGRAM_BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN")
13
  TELEGRAM_CHAT_ID = os.getenv("TELEGRAM_CHAT_ID")
14
 
 
 
 
15
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
16
  @tool
17
  def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
@@ -122,7 +125,7 @@ def generate_joke(subject: str) -> str:
122
 
123
  try:
124
  global model
125
- response = model.generate_text(prompt)
126
 
127
  return response.strip()
128
  except Exception as e:
 
12
  TELEGRAM_BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN")
13
  TELEGRAM_CHAT_ID = os.getenv("TELEGRAM_CHAT_ID")
14
 
15
+ if not TELEGRAM_BOT_TOKEN:
16
+ raise ValueError("TELEGRAM_BOT_TOKEN is missing! Did you set it in Hugging Face Secrets?")
17
+
18
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
19
  @tool
20
  def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
 
125
 
126
  try:
127
  global model
128
+ response = model.run(prompt)
129
 
130
  return response.strip()
131
  except Exception as e: