Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -29,38 +29,7 @@ def generate_response(prompt, max_tokens, temperature, top_p):
|
|
29 |
|
30 |
|
31 |
|
32 |
-
|
33 |
-
with gr.Blocks() as demo:
|
34 |
-
|
35 |
-
|
36 |
-
submit_button.click(
|
37 |
-
generate_response,
|
38 |
-
inputs=[prompt_input, max_tokens, temperature, top_p],
|
39 |
-
outputs=output_text,
|
40 |
-
)
|
41 |
-
|
42 |
-
with gr.Tab("OCR"):
|
43 |
-
with gr.Row():
|
44 |
-
with gr.Column():
|
45 |
-
image_input = gr.Image(
|
46 |
-
label="Upload Image",
|
47 |
-
type="filepath", # Corrected type
|
48 |
-
image_mode="RGB",
|
49 |
-
)
|
50 |
-
ocr_submit_button = gr.Button("Extract Text")
|
51 |
-
|
52 |
-
with gr.Column():
|
53 |
-
ocr_output = gr.Textbox(
|
54 |
-
label="Extracted Text",
|
55 |
-
lines=10,
|
56 |
-
interactive=False,
|
57 |
-
)
|
58 |
-
|
59 |
-
ocr_submit_button.click(
|
60 |
-
ocr_image,
|
61 |
-
inputs=[image_input],
|
62 |
-
outputs=ocr_output,
|
63 |
-
)
|
64 |
prompt =gr.Textbox()
|
65 |
max_tokens = gr.Textbox()
|
66 |
temperature = gr.Textbox()
|
|
|
29 |
|
30 |
|
31 |
|
32 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
prompt =gr.Textbox()
|
34 |
max_tokens = gr.Textbox()
|
35 |
temperature = gr.Textbox()
|