-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
27 lines (23 loc) · 672 Bytes
/
app.py
File metadata and controls
27 lines (23 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import gradio as gr
import json
from main import main
def process_json(file):
# Read the JSON file
with open(file.name, 'r') as f:
data = json.load(f)
summaries_dict = main(data=data)
output = ''
for category in summaries_dict:
output += category + ': \n'
output += summaries_dict[category] + "\n\n"
return output
# Create a Gradio interface
iface = gr.Interface(
fn=process_json,
inputs=gr.File(label="Upload JSON File"),
outputs="text",
title="Summary Note Agent",
description="Upload the form as JSON file and get Note summary in Conversation form."
)
# Launch the interface
iface.launch()