Spaces:
Sleeping
Sleeping
File size: 710 Bytes
b397a75 822fabb b397a75 498e1ca 822fabb b397a75 498e1ca 822fabb 498e1ca 822fabb b397a75 498e1ca |
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 |
import gradio as gr
from transformers import pipeline
# Load your text generation model from Hugging Face
model_name = "curiouscurrent/omnicode"
text_generator = pipeline("text-generation", model=model_name)
def generate_response(input_prompt):
# Generate response
response = text_generator(input_prompt, max_length=100)[0]['generated_text']
return response
# Create Gradio interface
input_prompt = gr.inputs.Textbox(lines=5, label="Input Prompt")
output_text = gr.outputs.Textbox(label="Response")
gr.Interface(
generate_response,
inputs=input_prompt,
outputs=output_text,
title="OmniCode",
description="Multi Programming coding assistant.",
theme="compact"
).launch()
|