Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import requests
|
3 |
+
|
4 |
+
def generate_answer(prompt):
|
5 |
+
# The URL of the Flask server
|
6 |
+
url = 'https://entelidemo.replit.app/generate_answer'
|
7 |
+
# The payload in JSON format
|
8 |
+
payload = {'prompt': prompt}
|
9 |
+
|
10 |
+
# Make a POST request to the server
|
11 |
+
response = requests.post(url, json=payload)
|
12 |
+
if response.status_code == 200:
|
13 |
+
return str(response.json())
|
14 |
+
else:
|
15 |
+
return "An error occurred"
|
16 |
+
|
17 |
+
def main():
|
18 |
+
interface = gr.Interface(
|
19 |
+
fn=generate_answer,
|
20 |
+
inputs="text",
|
21 |
+
outputs="text",
|
22 |
+
title="Enteli-49B Demo",
|
23 |
+
description="Normally model remembers its past conversations, however for demo purposes this feature is not included. Again it can be a bit slow since it is a demo only. System Prompt: You are a helpful AI assistant called Enteli developed by the AI company EnteliMind."
|
24 |
+
)
|
25 |
+
|
26 |
+
interface.launch()
|
27 |
+
|
28 |
+
if __name__ == "__main__":
|
29 |
+
main()
|