dev2089 commited on
Commit
be0504e
ยท
verified ยท
1 Parent(s): fbf609e

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +4 -19
app.py CHANGED
@@ -4,28 +4,20 @@ Deployed on Hugging Face Spaces
4
  """
5
 
6
  import gradio as gr
7
- import json
8
- import time
9
 
10
  def chat_with_devrayog(message, model_name, system_prompt):
11
- """Send chat request to Devrayog AI"""
12
-
13
  if not message.strip():
14
  return "Please enter a message."
15
 
16
  model_responses = {
17
- "Devrayog Agni (Fast)": f"๐Ÿ”ฅ [Devrayog Agni - Fast Response]\n\nThank you for your message: '{message}'\n\nI'm Devrayog Agni, the fast model optimized for quick responses. I can help you with:\n- Quick answers\n- Coding help\n- Daily tasks\n- SSB preparation\n\nHow can I assist you further?",
18
-
19
  "Devrayog Vayu (Creative)": f"๐ŸŒŠ [Devrayog Vayu - Creative Response]\n\nYour message: '{message}'\n\nI'm Devrayog Vayu, the creative model. I excel at:\n- Storytelling and creative writing\n- Brainstorming ideas\n- Content generation\n- Imaginative responses\n\nLet me craft something special for you!",
20
-
21
- "Devrayog Akash (Powerful)": f"๐ŸŒŒ [Devrayog Akash - Deep Response]\n\nAnalyzing your message: '{message}'\n\nI'm Devrayog Akash, the most powerful model. I specialize in:\n- Complex reasoning\n- Deep analysis\n- Research tasks\n- Multi-step problem solving\n\nLet me provide a comprehensive response."
22
  }
23
 
24
  response = model_responses.get(model_name, model_responses["Devrayog Agni (Fast)"])
25
-
26
  if system_prompt:
27
  response = f"[System: {system_prompt}]\n\n{response}"
28
-
29
  return response
30
 
31
  def get_model_info():
@@ -46,9 +38,7 @@ Best for: Complex reasoning, analysis, research
46
  **Tagline:** India's First Solo-Built AI
47
  """
48
 
49
- # Create Gradio interface
50
  with gr.Blocks(title="Devrayog AI") as demo:
51
-
52
  gr.Markdown("# ๐Ÿ‡ฎ๐Ÿ‡ณ Devrayog AI")
53
  gr.Markdown("*India's First Solo-Built AI - Founded by Devanshu Sharma (Hermes), Age 18, Rajasthan*")
54
 
@@ -59,10 +49,9 @@ with gr.Blocks(title="Devrayog AI") as demo:
59
  value="Devrayog Agni (Fast)",
60
  label="Select Model"
61
  )
62
- system_prompt_input = gr.Textbox(label="System Prompt (Optional)", placeholder="Set a custom system prompt...", lines=2)
63
  chat_btn = gr.Button("Send ๐Ÿš€", variant="primary")
64
  chat_output = gr.Textbox(label="Response", lines=10, interactive=False)
65
-
66
  chat_btn.click(fn=chat_with_devrayog, inputs=[chat_input, model_select, system_prompt_input], outputs=chat_output)
67
 
68
  with gr.Tab("๐Ÿ“š Models"):
@@ -100,13 +89,9 @@ To build India's most accessible and powerful AI, created by a young Indian foun
100
  - **Devrayog Vayu** - Creative and flowing (9B)
101
  - **Devrayog Akash** - Most powerful (8B)
102
 
103
- ### Links
104
- - Hugging Face: https://huggingface.co/dev2089
105
- - Founder: Devanshu Sharma (Hermes), Age 18, Rajasthan
106
-
107
  ---
108
  *Built with โค๏ธ in India ๐Ÿ‡ฎ๐Ÿ‡ณ*
109
  """)
110
 
111
  if __name__ == "__main__":
112
- demo.launch(server_name="0.0.0.0", server_port=7860)
 
4
  """
5
 
6
  import gradio as gr
 
 
7
 
8
  def chat_with_devrayog(message, model_name, system_prompt):
 
 
9
  if not message.strip():
10
  return "Please enter a message."
11
 
12
  model_responses = {
13
+ "Devrayog Agni (Fast)": f"๐Ÿ”ฅ [Devrayog Agni - Fast Response]\n\nYour message: '{message}'\n\nI'm Devrayog Agni, the fast model optimized for quick responses. I can help with:\n- Quick answers\n- Coding help\n- Daily tasks\n- SSB preparation\n\nHow can I assist you further?",
 
14
  "Devrayog Vayu (Creative)": f"๐ŸŒŠ [Devrayog Vayu - Creative Response]\n\nYour message: '{message}'\n\nI'm Devrayog Vayu, the creative model. I excel at:\n- Storytelling and creative writing\n- Brainstorming ideas\n- Content generation\n- Imaginative responses\n\nLet me craft something special for you!",
15
+ "Devrayog Akash (Powerful)": f"๐ŸŒŒ [Devrayog Akash - Deep Response]\n\nAnalyzing: '{message}'\n\nI'm Devrayog Akash, the most powerful model. I specialize in:\n- Complex reasoning\n- Deep analysis\n- Research tasks\n- Multi-step problem solving\n\nLet me provide a comprehensive response."
 
16
  }
17
 
18
  response = model_responses.get(model_name, model_responses["Devrayog Agni (Fast)"])
 
19
  if system_prompt:
20
  response = f"[System: {system_prompt}]\n\n{response}"
 
21
  return response
22
 
23
  def get_model_info():
 
38
  **Tagline:** India's First Solo-Built AI
39
  """
40
 
 
41
  with gr.Blocks(title="Devrayog AI") as demo:
 
42
  gr.Markdown("# ๐Ÿ‡ฎ๐Ÿ‡ณ Devrayog AI")
43
  gr.Markdown("*India's First Solo-Built AI - Founded by Devanshu Sharma (Hermes), Age 18, Rajasthan*")
44
 
 
49
  value="Devrayog Agni (Fast)",
50
  label="Select Model"
51
  )
52
+ system_prompt_input = gr.Textbox(label="System Prompt (Optional)", placeholder="Set custom system prompt...", lines=2)
53
  chat_btn = gr.Button("Send ๐Ÿš€", variant="primary")
54
  chat_output = gr.Textbox(label="Response", lines=10, interactive=False)
 
55
  chat_btn.click(fn=chat_with_devrayog, inputs=[chat_input, model_select, system_prompt_input], outputs=chat_output)
56
 
57
  with gr.Tab("๐Ÿ“š Models"):
 
89
  - **Devrayog Vayu** - Creative and flowing (9B)
90
  - **Devrayog Akash** - Most powerful (8B)
91
 
 
 
 
 
92
  ---
93
  *Built with โค๏ธ in India ๐Ÿ‡ฎ๐Ÿ‡ณ*
94
  """)
95
 
96
  if __name__ == "__main__":
97
+ demo.launch(server_name="0.0.0.0", server_port=7860, share=True)