Spaces:
Paused
Paused
Create Lordgpt
Browse files
Lordgpt
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def generate_response(prompt):
|
| 2 |
+
response = llm.create_chat_completion(
|
| 3 |
+
messages=[
|
| 4 |
+
{
|
| 5 |
+
"role": "user",
|
| 6 |
+
"content": prompt
|
| 7 |
+
}
|
| 8 |
+
]
|
| 9 |
+
)
|
| 10 |
+
return response["choices"][0]["message"]["content"]
|
| 11 |
+
|
| 12 |
+
iface = gr.Interface(
|
| 13 |
+
fn=generate_response,
|
| 14 |
+
inputs=gr.inputs.Textbox(lines=2, placeholder="Enter your prompt here..."),
|
| 15 |
+
outputs=gr.outputs.Textbox(),
|
| 16 |
+
title="Llama Model",
|
| 17 |
+
description="A Gradio interface to interact with the Llama model.",
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
iface.launch()
|