VeuReu commited on
Commit
5f9c964
·
verified ·
1 Parent(s): 5ef2eb1

Upload 9 files

Browse files
Files changed (2) hide show
  1. app.py +12 -12
  2. requirements.txt +0 -2
app.py CHANGED
@@ -103,18 +103,18 @@ with gr.Blocks(title="Salamandra Vision 7B · ZeroGPU") as demo:
103
  out = gr.Textbox(label="Descripción", lines=18)
104
 
105
  # UI
106
- btn.click(_infer_one, [in_img, in_txt, max_new, temp], out, api_name="describe")
107
 
108
  # API simple (multipart) compatible con tu versión anterior
109
- demo.load(
110
- None,
111
- [gr.Image(label="image", type="pil"),
112
- gr.Textbox(value="Describe la imagen con detalle."),
113
- gr.Slider(16, 1024, value=256),
114
- gr.Slider(0.0, 1.5, value=0.7)],
115
- describe_raw,
116
- api_name="describe_raw"
117
- )
118
 
119
  # API BATCH para ENGINE (Gradio Client): images + context_json → list[str]
120
  # Firma que espera el VisionClient del engine (api_name="/predict")
@@ -127,7 +127,7 @@ with gr.Blocks(title="Salamandra Vision 7B · ZeroGPU") as demo:
127
 
128
  # Nota: Gradio Gallery entrega rutas/obj; nos apoyamos en el cliente para cargar archivos
129
  batch_btn.click(describe_batch, [batch_in_images, batch_context, batch_max, batch_temp], batch_out,
130
- api_name="predict")
131
 
132
- demo.queue(concurrency_count=1, max_size=16).launch()
133
 
 
103
  out = gr.Textbox(label="Descripción", lines=18)
104
 
105
  # UI
106
+ btn.click(_infer_one, [in_img, in_txt, max_new, temp], out, api_name="describe", concurrency_limit=1)
107
 
108
  # API simple (multipart) compatible con tu versión anterior
109
+ # demo.load(
110
+ # None,
111
+ # [gr.Image(label="image", type="pil"),
112
+ # gr.Textbox(value="Describe la imagen con detalle."),
113
+ # gr.Slider(16, 1024, value=256),
114
+ # gr.Slider(0.0, 1.5, value=0.7)],
115
+ # describe_raw,
116
+ # api_name="describe_raw"
117
+ # )
118
 
119
  # API BATCH para ENGINE (Gradio Client): images + context_json → list[str]
120
  # Firma que espera el VisionClient del engine (api_name="/predict")
 
127
 
128
  # Nota: Gradio Gallery entrega rutas/obj; nos apoyamos en el cliente para cargar archivos
129
  batch_btn.click(describe_batch, [batch_in_images, batch_context, batch_max, batch_temp], batch_out,
130
+ api_name="predict", concurrency_limit=1)
131
 
132
+ demo.queue(max_size=16).launch()
133
 
requirements.txt CHANGED
@@ -1,5 +1,3 @@
1
- gradio>=4.44.1
2
- spaces>=0.25.0
3
  transformers>=4.44.0
4
  torch>=2.2
5
  accelerate>=0.30.0
 
 
 
1
  transformers>=4.44.0
2
  torch>=2.2
3
  accelerate>=0.30.0