AThirumoorthi commited on
Commit
eeee32e
·
verified ·
1 Parent(s): 96b719f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -11
app.py CHANGED
@@ -24,16 +24,16 @@ def get_completion(user_input):
24
 
25
  # Check if the user asks "Who made you?"
26
  if "who made you" in user_input.lower():
27
- return "Thirumoorthi"
28
 
29
  try:
30
  completion = client.chat.completions.create(
31
  model=MODEL_NAME,
32
  messages=[
33
- {"role": "system", "content": "You are a helpful assistant."},
34
  {"role": "user", "content": user_input}
35
  ],
36
- temperature=1,
37
  max_tokens=1024,
38
  top_p=1,
39
  stream=True,
@@ -54,8 +54,8 @@ def launch_interface():
54
  demo = gr.Interface(
55
  fn=get_completion,
56
  inputs=gr.Textbox(
57
- label="Enter your query:",
58
- placeholder="Ask me anything...",
59
  lines=2,
60
  max_lines=5,
61
  show_label=True,
@@ -68,13 +68,14 @@ def launch_interface():
68
  lines=6,
69
  max_lines=10
70
  ),
71
- title="Mr AI",
72
- description="Ask anything and get a helpful response.",
73
- theme="default",
74
  css="""
75
- .gr-box { border-radius: 10px; border: 1px solid #ccc; padding: 10px; }
76
- .gr-button { background-color: #4CAF50; color: white; }
77
- .gr-textbox { border-radius: 5px; }
 
78
  """,
79
  allow_flagging="never",
80
  live=True, # Enable live updates if supported
 
24
 
25
  # Check if the user asks "Who made you?"
26
  if "who made you" in user_input.lower():
27
+ return "I was created by Thirumoorthi, a brilliant mind working on AI systems!"
28
 
29
  try:
30
  completion = client.chat.completions.create(
31
  model=MODEL_NAME,
32
  messages=[
33
+ {"role": "system", "content": "You are a friendly and helpful assistant, like ChatGPT."},
34
  {"role": "user", "content": user_input}
35
  ],
36
+ temperature=0.7, # Slightly lower temperature for more controlled responses
37
  max_tokens=1024,
38
  top_p=1,
39
  stream=True,
 
54
  demo = gr.Interface(
55
  fn=get_completion,
56
  inputs=gr.Textbox(
57
+ label="Ask me anything:",
58
+ placeholder="I am here to help! Ask away...",
59
  lines=2,
60
  max_lines=5,
61
  show_label=True,
 
68
  lines=6,
69
  max_lines=10
70
  ),
71
+ title="Chat with Mr AI",
72
+ description="I am your friendly assistant, just like ChatGPT! Ask me anything, and I will do my best to help.",
73
+ theme="huggingface", # More modern theme
74
  css="""
75
+ .gr-box { border-radius: 15px; border: 1px solid #e1e1e1; padding: 20px; background-color: #f9f9f9; }
76
+ .gr-button { background-color: #4CAF50; color: white; font-size: 14px; }
77
+ .gr-textbox { border-radius: 8px; font-size: 16px; padding: 10px; }
78
+ .gr-output { background-color: #f1f1f1; border-radius: 8px; font-size: 16px; padding: 15px; }
79
  """,
80
  allow_flagging="never",
81
  live=True, # Enable live updates if supported