Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,20 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
demo = gr.Interface(
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
def process_repo_file(file):
|
4 |
+
if file is None:
|
5 |
+
return "No file uploaded."
|
6 |
+
try:
|
7 |
+
content = file.read().decode('utf-8')
|
8 |
+
repo_ids = [line.strip() for line in content.splitlines() if line.strip()]
|
9 |
+
return f"Uploaded repo IDs: {', '.join(repo_ids)}"
|
10 |
+
except Exception as e:
|
11 |
+
return f"Error reading file: {e}"
|
12 |
|
13 |
+
demo = gr.Interface(
|
14 |
+
fn=process_repo_file,
|
15 |
+
inputs=gr.File(label="Upload a file with repo IDs"),
|
16 |
+
outputs="text",
|
17 |
+
title="Repo ID Uploader",
|
18 |
+
description="Upload a text file containing one repo ID per line."
|
19 |
+
)
|
20 |
demo.launch()
|