Rouhani2025's picture
Create app.py
4634bca verified
raw
history blame contribute delete
609 Bytes
import gradio as gr
import requests
# Define the Colab backend URL (replace with your actual URL from Colab)
COLAB_BACKEND_URL = "https://2af5-34-124-205-95.ngrok-free.app"
def query_falcon(prompt):
response = requests.post(COLAB_BACKEND_URL, json={"prompt": prompt})
return response.json().get("response", "Error: Unable to fetch response from Colab")
interface = gr.Interface(
fn=query_falcon,
inputs="text",
outputs="text",
title="Falcon-7B Text Generation",
description="Enter a prompt and let Falcon-7B generate text!",
)
if __name__ == "__main__":
interface.launch()