File size: 662 Bytes
383ae46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: mit
---
import gradio as gr
import json

# Ngarko dataset
with open("dataset.json", "r") as f:
    data = json.load(f)

def get_recommendation(question):
    question_lower = question.lower()
    for item in data:
        if item["input"].lower() in question_lower:
            return item["output"]
    return "Ideja nuk u gjet në dataset. Provo pyetje tjetër 😊"

with gr.Blocks() as demo:
    gr.Markdown("## 🌟 Super AGI Minimal Demo")
    inp = gr.Textbox(label="Fut pyetjen tënde")
    out = gr.Textbox(label="Rekomandimi")
    btn = gr.Button("Merr rekomandim")
    btn.click(get_recommendation, inputs=inp, outputs=out)

demo.launch()