Mike369williams commited on
Commit
d4b89db
·
verified ·
1 Parent(s): 7acdea7

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -0
app.py ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import random
3
+
4
+ CANNED_RESPONSES = {
5
+ "introduce": "I am Sanchari — an upcoming AI assistant designed for multilingual and Indian language tasks. (Demo output only.)",
6
+ "summarize": "Demo summary: This is a placeholder summary. The real model will generate structured summaries after training.",
7
+ "email": "Demo email:\n\nHello,\n\nThis is a placeholder email drafted by Sanchari. Final model will generate complete business emails.\n\nRegards,\nSanchari",
8
+ "default": [
9
+ "Demo reply: Sanchari is under training. You’re viewing a preview demo.",
10
+ "Demo reply: Placeholder response for investor preview. Full outputs coming soon."
11
+ ]
12
+ }
13
+
14
+ def generate(prompt):
15
+ prompt_lower = prompt.lower()
16
+
17
+ if "introduce" in prompt_lower or "who are you" in prompt_lower:
18
+ return CANNED_RESPONSES["introduce"]
19
+ if "summary" in prompt_lower or "summar" in prompt_lower:
20
+ return CANNED_RESPONSES["summarize"]
21
+ if "email" in prompt_lower or "write" in prompt_lower:
22
+ return CANNED_RESPONSES["email"]
23
+
24
+ return random.choice(CANNED_RESPONSES["default"])
25
+
26
+ demo = gr.Interface(
27
+ fn=generate,
28
+ inputs=gr.Textbox(label="Your prompt here"),
29
+ outputs=gr.Textbox(label="Sanchari Demo Output"),
30
+ title="Sanchari — Demo (Investor Preview)",
31
+ description="This is a placeholder demo with canned responses. Full AI model coming soon after training."
32
+ )
33
+
34
+ demo.launch()