yejunliang23 commited on
Commit
1e00c03
·
unverified ·
1 Parent(s): 81fc7b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +47 -29
app.py CHANGED
@@ -107,35 +107,53 @@ PLACEHOLDER = (
107
  "<p style='font-size:18px;opacity:0.65;'>Ask anything or generate images!</p></div>"
108
  )
109
 
110
- demo = gr.Blocks(css=css)
111
- with demo:
112
- gr.Markdown("## Local Qwen2.5-VL + 3D Mesh Visualization")
113
- with gr.Row():
114
- with gr.Column(scale=3):
115
- chatbot = gr.Chatbot(label="Qwen2.5-VL-Local", height=450, placeholder=PLACEHOLDER)
116
- gr.ChatInterface(
117
- fn=chat_qwen_vl,
118
- chatbot=chatbot,
119
- temperature=0.7,
120
- max_new_tokens=1024,
121
- examples=[
122
- ["Hello, what is Qwen2.5-VL?"],
123
- ["Generate a simple Python function to sort a list."],
124
- ]
125
- )
126
- with gr.Column(scale=2):
127
- output_model = gr.Model3D(label="3D Mesh Visualization", interactive=False)
128
- mesh_input = gr.Textbox(
129
- label="3D Mesh OBJ Input",
130
- placeholder="Paste your 3D mesh in OBJ format here...",
131
- lines=5
132
- )
133
- visualize_btn = gr.Button("Visualize with Gradient Color")
134
- visualize_btn.click(
135
- fn=apply_gradient_color,
136
- inputs=[mesh_input],
137
- outputs=[output_model]
138
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
 
140
  if __name__ == "__main__":
141
  demo.launch()
 
107
  "<p style='font-size:18px;opacity:0.65;'>Ask anything or generate images!</p></div>"
108
  )
109
 
110
+ chatbot=gr.Chatbot(height=450, placeholder=PLACEHOLDER, label='Gradio ChatInterface')
111
+
112
+ with gr.Blocks(fill_height=True, css=css) as demo:
113
+ with gr.Column():
114
+ gr.Markdown(DESCRIPTION)
115
+ # gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
116
+ with gr.Row():
117
+ with gr.Column(scale=3):
118
+ gr.ChatInterface(
119
+ fn=chat_qwen_vl,
120
+ chatbot=chatbot,
121
+ fill_height=True,
122
+ additional_inputs_accordion=gr.Accordion(label="⚙️ Parameters", open=False, render=False),
123
+ additional_inputs=[
124
+ gr.Slider(minimum=0,
125
+ maximum=1,
126
+ step=0.1,
127
+ value=0.9,
128
+ label="Temperature",
129
+ interactive = False,
130
+ render=False),
131
+ gr.Slider(minimum=128,
132
+ maximum=4096,
133
+ step=1,
134
+ value=4096,
135
+ label="Max new tokens",
136
+ interactive = False,
137
+ render=False),
138
+ ],
139
+ examples=[
140
+ ['Create a 3D model of a wooden hammer'],
141
+ ['Create a 3D model of a pyramid in obj format'],
142
+ ['Create a 3D model of a cabinet.'],
143
+ ['Create a low poly 3D model of a coffe cup'],
144
+ ['Create a 3D model of a table.'],
145
+ ["Create a low poly 3D model of a tree."],
146
+ ['Write a python code for sorting.'],
147
+ ['How to setup a human base on Mars? Give short answer.'],
148
+ ['Explain theory of relativity to me like I’m 8 years old.'],
149
+ ['What is 9,000 * 9,000?'],
150
+ ['Create a 3D model of a soda can.'],
151
+ ['Create a 3D model of a sword.'],
152
+ ['Create a 3D model of a wooden barrel'],
153
+ ['Create a 3D model of a chair.']
154
+ ],
155
+ cache_examples=False,
156
+ )
157
 
158
  if __name__ == "__main__":
159
  demo.launch()