Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,8 +6,8 @@ model = genai.GenerativeModel("gemini-1.5-flash")
|
|
6 |
|
7 |
# Funci贸n para procesar el PDF y generar una respuesta
|
8 |
def process_pdf(file):
|
9 |
-
# Subir el archivo PDF local
|
10 |
-
sample_pdf = genai.upload_file(file.name)
|
11 |
|
12 |
# Crear el prompt para la API
|
13 |
prompt = "Give me a summary of this pdf file."
|
@@ -31,7 +31,7 @@ def chatbot_interface(user_input, history):
|
|
31 |
app = gr.Interface(
|
32 |
fn=chatbot_interface,
|
33 |
inputs=[
|
34 |
-
gr.File(file_count="single", type="
|
35 |
gr.State(), # Mantener el estado del historial
|
36 |
],
|
37 |
outputs=[
|
|
|
6 |
|
7 |
# Funci贸n para procesar el PDF y generar una respuesta
|
8 |
def process_pdf(file):
|
9 |
+
# Subir el archivo PDF local (usando filepath)
|
10 |
+
sample_pdf = genai.upload_file(file.name) # file.name ser谩 la ruta del archivo
|
11 |
|
12 |
# Crear el prompt para la API
|
13 |
prompt = "Give me a summary of this pdf file."
|
|
|
31 |
app = gr.Interface(
|
32 |
fn=chatbot_interface,
|
33 |
inputs=[
|
34 |
+
gr.File(file_count="single", type="filepath", label="Upload PDF Document"), # Cambi茅 'file' por 'filepath'
|
35 |
gr.State(), # Mantener el estado del historial
|
36 |
],
|
37 |
outputs=[
|