File size: 593 Bytes
bcdbc6b 5c99ca9 470968b 0c1ab2c ad399c6 1f18d22 470968b ad399c6 1f18d22 5c99ca9 0c1ab2c ad399c6 5c99ca9 2c09a04 bcdbc6b ad399c6 626257f ad399c6 bcdbc6b |
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 gradio as gr
from datasets import load_dataset
import huggingface_hub as hh
from huggingface_hub import HfApi
from huggingface_hub import HfFileSystem
import os
repo_id = os.environ['repo_id']
hh.login(token=os.environ['token'])
api = HfApi()
file_list = api.list_repo_files(repo_id=repo_id, repo_type="space")
print(file_list)
fs = HfFileSystem()
with fs.open(f"spaces/{repo_id}/info/副脾_症状.txt") as f:
data = f.read().decode()
print(data)
def greet(name):
return "Hello " + name + "!!"
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch() |