Skip to content

Commit

Permalink
add interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Josephrp committed Apr 19, 2024
1 parent f98202d commit 2567d24
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/template/apptemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def generate_response(self, prompt, model="curie", max_tokens=150, temperature=0
response = requests.post(url, headers=self.headers, json=data)
return response.json().get('choices')[0]['text']


# Application logic
def chatbot_response(user_query):
vectara_client = VectaraClientExtended(VECTARA_CUSTOMER_ID, VECTARA_API_KEY)
Expand All @@ -67,15 +68,15 @@ def chatbot_response(user_query):

# Gradio interface setup
def main():
iface = gr.Chatbot(
fn=chatbot_response,
iface = gr.Interface(
chatbot_response,
inputs=gr.Textbox(lines=2, placeholder="Enter your query here..."),
outputs="text",
outputs=gr.Textbox(),
title="Vectonic ChatBot",
description="Optimized Using Tonicai. Powered by Vectara and TogetherAI. Ask anything!",
)

iface.launch()

if __name__ == "__main__":
main()
main()

0 comments on commit 2567d24

Please sign in to comment.