Spaces:
Runtime error
Runtime error
File size: 631 Bytes
1f53559 cfc9e26 1f53559 93cfa6a 99ec9bc 1f53559 5462aaf |
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 |
import os
import gradio as gr
from huggingface_hub import InferenceClient
def analyze_project(project_data, question):
api_key = os.getenv("HF_API_KEY")
client = InferenceClient(api_key=api_key)
prompt = f"Analyze this project: {project_data}\n\nQuestion: {question}"
inputs = client.encoding("text", prompt)
outputs = client.generate(
model="Qwen/Qwen2.5-72B-Instruct",
inputs=inputs,
max_new_tokens=100
)
return outputs["generated_text"][0]
iface = gr.Interface(
fn=analyze_project,
inputs=["text", "text"],
outputs="text"
)
iface.launch(share=True, api=True) |