Spaces:
Runtime error
Runtime error
Delete app.py
Browse files
app.py
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
-
|
4 |
-
# Load a lightweight test-case generation model
|
5 |
-
generator = pipeline("text2text-generation", model="Salesforce/codet5p-770m", max_length=512)
|
6 |
-
|
7 |
-
def generate_tests(code, instruction):
|
8 |
-
prompt = f"Input:\n{code}\n\nInstruction:\n{instruction}"
|
9 |
-
result = generator(prompt)[0]["generated_text"]
|
10 |
-
return result
|
11 |
-
|
12 |
-
gr.Interface(
|
13 |
-
fn=generate_tests,
|
14 |
-
inputs=[
|
15 |
-
gr.Textbox(label="Your Code", lines=10, placeholder="Paste your function here..."),
|
16 |
-
gr.Textbox(label="Instruction", placeholder="e.g., Generate unit tests using Python unittest.")
|
17 |
-
],
|
18 |
-
outputs=gr.Code(language="python"),
|
19 |
-
title="🧪 Unit Test & Test Case Generator",
|
20 |
-
description="🔧 Paste your function and get auto-generated test cases using a free model from Hugging Face."
|
21 |
-
).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|