MaziyarPanahi commited on
Commit
d1d19bb
1 Parent(s): 3c073e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -11,6 +11,9 @@ import torch
11
  import spaces
12
  import requests
13
 
 
 
 
14
  model_id = "xtuner/llava-llama-3-8b-v1_1-transformers"
15
 
16
  processor = AutoProcessor.from_pretrained(model_id)
@@ -63,8 +66,10 @@ def bot_streaming(message, history):
63
  yield generated_text_without_prompt
64
 
65
 
66
- demo = gr.ChatInterface(fn=bot_streaming, fill_height=True, title="LLaVA Llama-3-8B", examples=[{"text": "What is on the flower?", "files":["./bee.jpg"]},
67
  {"text": "How to make this pastry?", "files":["./baklava.png"]}],
68
  description="Try [LLaVA Llama-3-8B](https://huggingface.co/xtuner/llava-llama-3-8b-v1_1-transformers). Upload an image and start chatting about it, or simply try one of the examples below. If you don't upload an image, you will receive an error.",
69
  stop_btn="Stop Generation", multimodal=True)
70
- demo.launch(debug=True)
 
 
 
11
  import spaces
12
  import requests
13
 
14
+ CSS ="""
15
+ #component-3 { height: 400px; }
16
+ """
17
  model_id = "xtuner/llava-llama-3-8b-v1_1-transformers"
18
 
19
  processor = AutoProcessor.from_pretrained(model_id)
 
66
  yield generated_text_without_prompt
67
 
68
 
69
+ demo = gr.ChatInterface(fn=bot_streaming, css=CSS, fill_height=True, title="LLaVA Llama-3-8B", examples=[{"text": "What is on the flower?", "files":["./bee.jpg"]},
70
  {"text": "How to make this pastry?", "files":["./baklava.png"]}],
71
  description="Try [LLaVA Llama-3-8B](https://huggingface.co/xtuner/llava-llama-3-8b-v1_1-transformers). Upload an image and start chatting about it, or simply try one of the examples below. If you don't upload an image, you will receive an error.",
72
  stop_btn="Stop Generation", multimodal=True)
73
+
74
+ demo.queue(default_concurrency_limit=20, max_size=20, api_open=False)
75
+ demo.launch(show_api=False, share=False)