MohammedAlakhras commited on
Commit
e3ce00c
β€’
1 Parent(s): 228c685

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -0
app.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import platform
2
+ import pathlib
3
+ import os
4
+
5
+ import gradio as gr
6
+ import random
7
+ import time
8
+ from gradio_client import Client
9
+
10
+
11
+ plt = platform.system()
12
+ pathlib.WindowsPath = pathlib.PosixPath
13
+
14
+ api = os.environ['API']
15
+
16
+
17
+ def chat(message,history):
18
+ client = Client(api)
19
+ result = client.predict(
20
+ message,
21
+ api_name="/chat"
22
+ )
23
+ return result
24
+
25
+ description='''
26
+ <br/>
27
+ 🌍 AI Chat Bot is available worldwide in over **160 languages**.<br/>
28
+ πŸ’¬ This space is powered by **Huggingface Hosting**.<br/>
29
+ πŸš€ This space runs **very fast** even on **CPU**.<br/>
30
+ <a href="https://www.facebook.com/MohammedAlakras">πŸ”— Facebook Account. </a><br/>
31
+ <a href="https://github.com/mohammedalakhras/">πŸ”— Github Account. </a><br/>
32
+
33
+
34
+ '''
35
+ gr.ChatInterface(chat, title='Mohammed Alakhras AI Chat Bot πŸ’¬', description=description).launch(share=True)