sugiv commited on
Commit
9dc0f22
·
1 Parent(s): 64d28ca

Adding a disclaimer on top

Browse files
Files changed (1) hide show
  1. app.py +28 -8
app.py CHANGED
@@ -102,13 +102,33 @@ def generate_response(user_query, top_k=5):
102
  return recommendations
103
 
104
  # Create Gradio interface
105
- iface = gr.Interface(
106
- fn=generate_response,
107
- inputs=gr.Textbox(lines=2, placeholder="Enter your query about LeetCode problems..."),
108
- outputs="text",
109
- title="LeetCode Problem Assistant",
110
- description="Ask about LeetCode problems and get structured responses."
111
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
  # Launch the app
114
- iface.launch(share=True)
 
102
  return recommendations
103
 
104
  # Create Gradio interface
105
+ with gr.Blocks() as iface:
106
+ gr.Markdown("# LeetCode Problem Assistant")
107
+
108
+ disclaimer = gr.Textbox(
109
+ value=" This is purely for Educational purpose only. We don't claim ownership of Problem statement\n"
110
+ " Copyright of problems and contents goes to Leetcode. Leetcode was not scraped as per terms.\n"
111
+ "• Do not rely solely on this tool for interview preparation.\n"
112
+ "• Always verify information with official LeetCode resources.",
113
+ label="Disclaimer",
114
+ interactive=False
115
+ )
116
+
117
+ query_input = gr.Textbox(
118
+ lines=2,
119
+ placeholder="Enter your natural language query about LeetCode problems...",
120
+ label="Your Query"
121
+ )
122
+
123
+ output = gr.Textbox(label="Search Results")
124
+
125
+ submit_button = gr.Button("Search")
126
+
127
+ submit_button.click(
128
+ fn=generate_response,
129
+ inputs=query_input,
130
+ outputs=output
131
+ )
132
 
133
  # Launch the app
134
+ iface.launch(share=True)