LysandreJik commited on
Commit
721f65d
1 Parent(s): c3e3b63

Dataset upload

Browse files
Files changed (2) hide show
  1. .gitattributes +0 -34
  2. app.py +11 -3
.gitattributes DELETED
@@ -1,34 +0,0 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tflite filter=lfs diff=lfs merge=lfs -text
29
- *.tgz filter=lfs diff=lfs merge=lfs -text
30
- *.wasm filter=lfs diff=lfs merge=lfs -text
31
- *.xz filter=lfs diff=lfs merge=lfs -text
32
- *.zip filter=lfs diff=lfs merge=lfs -text
33
- *.zst filter=lfs diff=lfs merge=lfs -text
34
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import os
2
  from io import BytesIO
3
 
@@ -62,11 +63,18 @@ with gr.Blocks() as demo:
62
 
63
  internship_choice.change(filter_species, internship_choice, [summary, details_col])
64
 
65
- def on_click(_details, _username):
66
- upload_file(path_or_fileobj=BytesIO(_details), path_in_repo=_username, repo_id='lysandre/internships', repo_type='dataset', token=os.environ['HF_TOKEN'])
 
 
 
 
 
 
 
67
  return f"Submitted: '{_details}' for user '{_username}'"
68
 
69
- generate_btn.click(on_click, inputs=[details, username], outputs=[output])
70
 
71
 
72
  if __name__ == "__main__":
 
1
+ import json
2
  import os
3
  from io import BytesIO
4
 
 
63
 
64
  internship_choice.change(filter_species, internship_choice, [summary, details_col])
65
 
66
+ def on_click(_details, _username, _internship_choice):
67
+ response = {'response': _details, "internship": _internship_choice}
68
+ upload_file(
69
+ path_or_fileobj=BytesIO(bytes(json.dumps(response), 'utf-8')),
70
+ path_in_repo=_username,
71
+ repo_id='lysandre/internships',
72
+ repo_type='dataset',
73
+ token=os.environ['HF_TOKEN']
74
+ )
75
  return f"Submitted: '{_details}' for user '{_username}'"
76
 
77
+ generate_btn.click(on_click, inputs=[details, username, internship_choice], outputs=[output])
78
 
79
 
80
  if __name__ == "__main__":