johnbradley commited on
Commit
951ca42
·
1 Parent(s): bc8fe8b

Download file from dataset

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -1,7 +1,15 @@
1
  import gradio as gr
 
 
 
 
 
 
 
 
2
 
3
  def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
  demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  demo.launch()
 
1
  import gradio as gr
2
+ import json
3
+ from huggingface_hub import hf_hub_download
4
+
5
+ hf_hub_download(repo_id="johnbradley/Test-Dataset", filename="data.json", repo_type="dataset")
6
+ with open("data.json") as infile:
7
+ data = json.load(infile)
8
+ print(data)
9
+
10
 
11
  def greet(name):
12
+ return "Hello " + name + "!!" + data.get("secret")
13
 
14
  demo = gr.Interface(fn=greet, inputs="text", outputs="text")
15
  demo.launch()