Spaces:
Sleeping
Sleeping
Commit
·
16d56a1
1
Parent(s):
5823725
test
Browse files
app.py
CHANGED
@@ -3,7 +3,6 @@ import pytesseract
|
|
3 |
import os
|
4 |
import pymupdf
|
5 |
|
6 |
-
import streamlit as st
|
7 |
import gradio as gr
|
8 |
from prepare import prepare
|
9 |
|
@@ -61,12 +60,13 @@ def query_huggingface(text):
|
|
61 |
return chat_model.invoke(text)
|
62 |
|
63 |
# Gradio Interface for PDF Processing
|
64 |
-
def process_file(file):
|
65 |
temp_file_path = "temp_uploaded_file"
|
66 |
with open(temp_file_path, "wb") as temp_file:
|
67 |
temp_file.write(file.read())
|
68 |
pdf_output = read_pdf(temp_file_path)
|
69 |
-
|
|
|
70 |
|
71 |
# Create Gradio App
|
72 |
interface = gr.Interface(
|
|
|
3 |
import os
|
4 |
import pymupdf
|
5 |
|
|
|
6 |
import gradio as gr
|
7 |
from prepare import prepare
|
8 |
|
|
|
60 |
return chat_model.invoke(text)
|
61 |
|
62 |
# Gradio Interface for PDF Processing
|
63 |
+
def process_file(file, query):
|
64 |
temp_file_path = "temp_uploaded_file"
|
65 |
with open(temp_file_path, "wb") as temp_file:
|
66 |
temp_file.write(file.read())
|
67 |
pdf_output = read_pdf(temp_file_path)
|
68 |
+
huggingface_output = query_huggingface(query)
|
69 |
+
return pdf_output, huggingface_output
|
70 |
|
71 |
# Create Gradio App
|
72 |
interface = gr.Interface(
|