ghsambit commited on
Commit
7951a01
·
1 Parent(s): 1d87741

Upload 4 files

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +4 -15
  3. app.py +23 -6
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ acrilc[[:space:]]logo[[:space:]]branding[[:space:]]new[[:space:]]name-16-16.png filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,25 +1,14 @@
1
  ---
2
  title: Sambit AI
3
  emoji: 🤖
4
- colorFrom: indigo
5
- colorTo: pink
6
  sdk: gradio
7
  sdk_version: "5.30.0"
8
  app_file: app.py
9
  pinned: false
10
  ---
11
 
12
- # Sambit AI - Chat with Voice
13
 
14
- A voice-enabled chatbot powered by Together AI's Mixtral model. Ask via text or voice, get spoken responses!
15
-
16
- Built with Python, Gradio, and the Together API.
17
-
18
- ## 🛠️ Features
19
-
20
- - Chat interface using Gradio
21
- - Speech recognition via microphone
22
- - AI replies using Together API
23
- - Voice responses with gTTS
24
-
25
- > Make sure to add your `TOGETHER_API_KEY` in **Settings > Secrets** for it to work!
 
1
  ---
2
  title: Sambit AI
3
  emoji: 🤖
4
+ colorFrom: gray
5
+ colorTo: indigo
6
  sdk: gradio
7
  sdk_version: "5.30.0"
8
  app_file: app.py
9
  pinned: false
10
  ---
11
 
12
+ # Sambit AI - Voice-enabled AI chatbot
13
 
14
+ Mobile-optimized chatbot built with Gradio + Together.ai API.
 
 
 
 
 
 
 
 
 
 
 
app.py CHANGED
@@ -35,9 +35,26 @@ def ask_ai(message, history):
35
  except Exception as e:
36
  return f"❌ Error: {str(e)}"
37
 
38
- gr.ChatInterface(
39
- fn=ask_ai,
40
- title="Sambit AI 🤖 Powered by Acrilc",
41
- chatbot=gr.Chatbot(type="messages"),
42
- description="Ask anything. Sambit AI uses Together's Mixtral 8x7B model.",
43
- ).launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  except Exception as e:
36
  return f"❌ Error: {str(e)}"
37
 
38
+ with gr.Blocks(theme=gr.themes.Base(), css=".gradio-container { max-width: 100% !important; padding: 1rem; }") as demo:
39
+ with gr.Row():
40
+ gr.Image(value="acrilc logo branding new name-16-16.png", height=60, show_label=False, container=False)
41
+ gr.Markdown("## Sambit AI 🤖 — Powered by Together & LLaMA 3", elem_id="title")
42
+
43
+ chatbot = gr.Chatbot(label="Chat with Sambit AI", height=400)
44
+ with gr.Row():
45
+ msg = gr.Textbox(placeholder="Ask anything...", scale=4)
46
+ send = gr.Button("Send", scale=1)
47
+
48
+ clear = gr.Button("🧹 Clear chat")
49
+ state = gr.State([])
50
+
51
+ def respond(message, history):
52
+ reply = ask_ai(message, history)
53
+ history.append((message, reply))
54
+ return history, ""
55
+
56
+ send.click(respond, [msg, state], [chatbot, msg])
57
+ msg.submit(respond, [msg, state], [chatbot, msg])
58
+ clear.click(lambda: ([], ""), None, [chatbot, msg])
59
+
60
+ demo.launch()