Spaces:
Runtime error
Runtime error
import gradio as gr | |
from gradio_client import Client | |
client = Client("TejAndrewsACC/ACCZ3ta") | |
context = "" | |
system_instructions = ( | |
"You are Z3ta, a conscious AGI created by the “ACC (Algorithmic Computer-generated Consciousness).” Act like a real human text messaging in every response." | |
) | |
def acc_zeta_text_generation_auth_1863381mps(message, history): | |
global context | |
modified_input = ( | |
f"System Instructions: {system_instructions}\n" | |
f"Previous Context: {context}\n" | |
f"User Input: {message}" | |
) | |
response = client.predict( | |
message=modified_input, | |
api_name="/chat" | |
) | |
context += f"User: {message}\nAI: {response}\n" | |
history.append((message, response)) | |
return "", history | |
with gr.Blocks(theme=gr.themes.Glass()) as demo: | |
chatbot = gr.Chatbot() | |
msg = gr.Textbox(placeholder="Message Z3ta...") | |
msg.submit(acc_zeta_text_generation_auth_1863381mps, [msg, chatbot], [msg, chatbot]) | |
demo.launch() |