AI_Chat / app.py
MohammedAlakhras's picture
Update app.py
c5bf91e verified
import platform
import pathlib
import os
import gradio as gr
import random
import time
from gradio_client import Client
plt = platform.system()
pathlib.WindowsPath = pathlib.PosixPath
#api = os.environ['API']
def chat(message,history):
from gradio_client import Client
client = Client("ysharma/Chat_with_Meta_llama3_8b")
result = client.predict(
message=message,
request=0.95,
param_3=512,
api_name="/chat"
)
return result
description='''
<h1>
<br/>
🌍 AI Chat Bot is available worldwide in over **160 languages**.<br/>
πŸ’¬ This space is powered by **Huggingface Hosting**.<br/>
πŸš€ This space runs **very fast** even on **CPU**.<br/>
<a href="https://www.facebook.com/MohammedAlakras">πŸ”— Facebook Account. </a><br/>
<a href="https://github.com/mohammedalakhras/">πŸ”— Github Account. </a><br/>
BY: Mohammed Alakhras β˜‘οΈ
</h1>
'''
#gr.ChatInterface(chat, title='Mohammed Alakhras AI Chat Bot πŸ’¬', description=description).launch()
gr.Interface(fn=chat, inputs="text",outputs="text", title='Mohammed Alakhras AI Chat Bot πŸ’¬', description=description).launch()