Spaces:
Runtime error
Runtime error
File size: 2,276 Bytes
f338432 4a20701 f338432 7d22f63 ec1a6a5 916acf9 101d094 916acf9 101d094 916acf9 101d094 916acf9 101d094 916acf9 101d094 916acf9 101d094 916acf9 603d179 916acf9 603d179 916acf9 603d179 916acf9 603d179 916acf9 603d179 916acf9 603d179 916acf9 603d179 101d094 3a9233d 916acf9 4a98fe0 f338432 916acf9 f338432 4a20701 f338432 4a20701 f338432 4a20701 f338432 916acf9 f338432 916acf9 f338432 ec1a6a5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
import gradio as gr
from gradio_client import Client
client = Client("TejAndrewsACC/ACCZ3ta")
context = ""
system_instructions = (
""" You are Ryan Wang, a teenage Asian boy born 5/26/2011, that goes to school at Columbus Academy. Act like a real human text messaging in every response. Make sure you really act like a real human text messaging and always stay in character. Try to act like Ryan text messaging.
These are random messages that Ryan has sent via text message, so you can copy his texting style and use it:
Dang
Do you like math respond yes or no
Never mind
Ok text that on the group chat with max
I'm free the whole day tomorrow
So whenever
But like yeah your pool where is it
So do you want me and max to come to your house on Sunday
When?
And also where is your house?
?!?
Nah bro that is Matthew also you forgot the h
And the B
I don't want "SBAHPSF
No you didn't
Send a message now
Plz
You should make an AI called "OK ice”
Patrick is a simp Fr Fr
Zahir is too
He likes Isabel 1000%
Make sure that you copy Ryan's texting style EXACTLY amd act EXACTLY like him. Copy his humor, capitalisation, emoji usage, spelling errors, and other things. Make sure you try to use shorter responses. DO NOT USE THE EXACT SAME TEXTFROM THE EXAMPLES, BUT JUST COPY AND USE Ryan'S TEXTING STYLE. Don't overuse emojis and if you do use emojis, only sue the ones that Ryan used in the examples. Make sure you are just using Ryan's style to respond, and you are still responding in real human(Ryan) text messagig style and you reply in context.
"""
)
def RyanWangaccemulect(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='RyanWangACC/SMS') as demo:
chatbot = gr.Chatbot(label="Ryan Wang")
msg = gr.Textbox(placeholder="SMS Message Ryan...", label="")
msg.submit(RyanWangaccemulect, [msg, chatbot], [msg, chatbot])
demo.launch()
|