AdamyaG commited on
Commit
8b4641b
1 Parent(s): 1cafb1d

Update chatbot.py

Browse files
Files changed (1) hide show
  1. chatbot.py +20 -20
chatbot.py CHANGED
@@ -301,28 +301,28 @@ def model_inference( user_prompt, chat_history):
301
  output += response.token.text
302
  yield output
303
 
304
- elif json_data["name"] == "image_generation":
305
- query = json_data["arguments"]["query"]
306
- gr.Info("Generating Image, Please wait 10 sec...")
307
- yield "Generating Image, Please wait 10 sec..."
308
- # try:
309
- # image = image_gen(f"{str(query)}")
310
- # yield gr.Image(image[1])
311
- # except:
312
- client_sd3 = InferenceClient("stabilityai/stable-diffusion-3-medium-diffusers")
313
- seed = random.randint(0,999999)
314
- image = client_sd3.text_to_image(query, negative_prompt=f"{seed}")
315
- gr.Info("Using Stability diffusion 3")
316
- yield "Using Stability diffusion 3"
317
- yield gr.Image(image)
318
 
319
 
320
- elif json_data["name"] == "video_generation":
321
- query = json_data["arguments"]["query"]
322
- gr.Info("Generating Video, Please wait 15 sec...")
323
- yield "Generating Video, Please wait 15 sec..."
324
- video = video_gen(f"{str(query)}")
325
- yield gr.Video(video)
326
 
327
  elif json_data["name"] == "image_qna":
328
  inputs = llava(user_prompt, chat_history)
 
301
  output += response.token.text
302
  yield output
303
 
304
+ # elif json_data["name"] == "image_generation":
305
+ # query = json_data["arguments"]["query"]
306
+ # gr.Info("Generating Image, Please wait 10 sec...")
307
+ # yield "Generating Image, Please wait 10 sec..."
308
+ # # try:
309
+ # # image = image_gen(f"{str(query)}")
310
+ # # yield gr.Image(image[1])
311
+ # # except:
312
+ # client_sd3 = InferenceClient("stabilityai/stable-diffusion-3-medium-diffusers")
313
+ # seed = random.randint(0,999999)
314
+ # image = client_sd3.text_to_image(query, negative_prompt=f"{seed}")
315
+ # gr.Info("Using Stability diffusion 3")
316
+ # yield "Using Stability diffusion 3"
317
+ # yield gr.Image(image)
318
 
319
 
320
+ # elif json_data["name"] == "video_generation":
321
+ # query = json_data["arguments"]["query"]
322
+ # gr.Info("Generating Video, Please wait 15 sec...")
323
+ # yield "Generating Video, Please wait 15 sec..."
324
+ # video = video_gen(f"{str(query)}")
325
+ # yield gr.Video(video)
326
 
327
  elif json_data["name"] == "image_qna":
328
  inputs = llava(user_prompt, chat_history)