akhaliq HF staff commited on
Commit
a7a9d84
1 Parent(s): d6f2717

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +122 -1
README.md CHANGED
@@ -7,4 +7,125 @@ sdk: static
7
  pinned: false
8
  ---
9
 
10
- Edit this `README.md` markdown file to author your organization card 🔥
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  pinned: false
8
  ---
9
 
10
+ <div class="grid lg:grid-cols-2 gap-x-4">
11
+ <h1 class="my-8 lg:col-span-2" style="font-size:20px; font-weight:bold">EuroScipy 2022</h1>
12
+ <p class="lg:col-span-2">EuroPython Dublin, You're invited!</p>
13
+ <p class="lg:col-span-2">
14
+ Welcome to the 14th European Conference on Python in Science. The EuroSciPy meeting is a cross-disciplinary gathering focused on the use and development of the Python language in scientific research.This event strives to bring together both users and developers of scientific tools, as well as academic research and state of the art industry.</p>
15
+
16
+ <h2 class="my-8 lg:col-span-2" style="font-size:20px; font-weight:bold">Hugging Face Gradio Hackathon 🤗 </h2>
17
+ <p class="lg:col-span-2">
18
+ Come Join us from August 29th to September 2th for a Hackathon in person and online using Gradio and Hugging Face to build and host Machine Learning and data science demos. Find tutorial on getting started with Gradio on Hugging Face <a href="https://huggingface.co/course/chapter9/1?fw=pt" style="text-decoration: underline" target="_blank">here</a> and to get started with the new Gradio Blocks API <a href="https://gradio.app/introduction_to_blocks/" style="text-decoration: underline" target="_blank">here</a>. Once the gradio demo is setup, see how to add it to Hugging Face Spaces <a href="https://huggingface.co/docs/hub/spaces-sdks-gradio" style="text-decoration: underline" target="_blank">here</a>. <b>Come see the talk on <a href="https://ep2022.europython.eu/session/how-to-craft-awesome-machine-learning-demos-with-python" style="text-decoration: underline" target="_blank">How to craft awesome Machine Learning demos with Python</a> in Liffey Hall 2 on 13 July 2022 at 14:00 by <a href="https://huggingface.co/osanseviero" style="text-decoration: underline" target="_blank">Omar Sanseviero</a></b></p>
19
+
20
+ <h3 class="my-8 lg:col-span-2" style="font-size:20px; font-weight:bold">Sprint July 16 and 17</h3>
21
+ <ul class="lg:col-span-2" style="list-style: circle inside;padding-left: 40px;">
22
+ <li class="my-4">Number of people: 3 maintainers + anyone willing to join
23
+ </li>
24
+ <li class="my-4">Build Machine Learning demos. You can also join if you don't know much about ML!</li>
25
+ <li class="my-4">Liffey Hall 2</li>
26
+ <li class="my-4">Python Level: any</li>
27
+ </ul>
28
+
29
+ <h3 class="my-8 lg:col-span-2" style="font-size:20px; font-weight:bold">Join organization by clicking <a href="https://huggingface.co/organizations/EuroPython2022/share/sVhJHDTrJDJkyWTJsRUwTHCSMZYUPlMhUt" style="text-decoration: underline" target="_blank">here</a></h3>
30
+
31
+ <img class="lg:col-span-2" src="https://i.imgur.com/N6sZ5CI.png" alt="Europython Banner" style="margin:10px">
32
+
33
+ <h3 class="my-8 lg:col-span-2" style="font-size:20px; font-weight:bold">Potential ideas for creating spaces: </h3>
34
+ <ul class="lg:col-span-2" style="list-style: circle inside;padding-left: 40px;">
35
+ <li class="my-4">Trending papers from <a href="https://paperswithcode.com/" style="text-decoration: underline">https://paperswithcode.com/</a></li>
36
+ <li class="my-4">Models from huggingface model hub: <a href="https://huggingface.co/models" style="text-decoration: underline">https://huggingface.co/models</a></li>
37
+ <li class="my-4">Papers from NAACL 2022 event <a href="https://huggingface.co/NAACL2022" style="text-decoration: underline">https://huggingface.co/NAACL2022</a></li>
38
+ <li class="my-4">Papers from ICML 2022 event <a href="https://huggingface.co/ICML2022" style="text-decoration: underline">https://huggingface.co/ICML2022</a></li>
39
+ <li class="my-4">Hugging Face course event ideas <a href="https://discuss.huggingface.co/c/course/course-event/25" style="text-decoration: underline">https://discuss.huggingface.co/c/course/course-event/25</a></li>
40
+ <li class="my-4">Models from other model hubs
41
+ <ul class="lg:col-span-2" style="list-style: circle inside;padding-left: 40px;">
42
+ <li class="my-4">Tensorflow Hub: see example Gradio demos at <a href="https://huggingface.co/tensorflow" style="text-decoration: underline">https://huggingface.co/tensorflow</a></li>
43
+ <li class="my-4">Pytorch Hub: see example Gradio demos at <a href="https://huggingface.co/pytorch" style="text-decoration: underline">https://huggingface.co/pytorch</a></li>
44
+ <li class="my-4">ONNX model Hub: see example Gradio demos at <a href="https://huggingface.co/onnx" style="text-decoration: underline">https://huggingface.co/onnx</a></li>
45
+ <li class="my-4">PaddlePaddle Model Hub: see example Gradio demos at <a href="https://huggingface.co/PaddlePaddle" style="text-decoration: underline">https://huggingface.co/PaddlePaddle</a></li>
46
+ </ul>
47
+ </li>
48
+ <li class="my-4">Try your own ideas!</li>
49
+ </ul>
50
+
51
+ <h4 class="my-8 lg:col-span-2" style="font-size:20px; font-weight:bold" id="Prizes">Hugging Face Prizes</h4>
52
+ <ul class="lg:col-span-2" style="list-style: circle inside">
53
+ <li class="my-4">Top 5 spaces based on likes<ul class="lg:col-span-2" style="list-style: circle inside;padding-left: 40px;">
54
+ <li class="my-4">Swag from <a href="https://huggingface.myshopify.com/">Hugging Face merch shop</a>: t-shirt, hoodie, or mug of your choice</li>
55
+ </ul>
56
+ </li>
57
+ </ul>
58
+
59
+ <h3 class="my-8 lg:col-span-2" style="font-size:20px; font-weight:bold">LeaderBoard for Most Popular EuroPython Spaces</h3>
60
+ <p class="lg:col-span-2">See the <a href="https://huggingface.co/spaces/EuroPython2022/Leaderboard" target="_blank" style="text-decoration:underline; font-weight:bold">EuroPython Leaderboard</a></p>
61
+ <h4 class="my-8 lg:col-span-2" style="font-size:20px; font-weight:bold">Hugging Face Spaces & Gradio for Showcasing your EuroPython ‘22 Demo
62
+ </h4>
63
+ <p class="lg:col-span-2">
64
+ In this tutorial, we will demonstrate how to showcase your demo with an easy to use web interface using the Gradio Python library and host it on Hugging Face Spaces so that conference attendees can easily find and try out your demos. Also, see <a href="https://gradio.app/introduction_to_blocks/" style="text-decoration: underline" target="_blank">https://gradio.app/introduction_to_blocks/</a>, for a more flexible way to build Gradio Demos
65
+ </p>
66
+ <h3 class="my-8 lg:col-span-2" style="font-size:20px; font-weight:bold">🚀 Create a Gradio Demo from your Model
67
+ </h3>
68
+ <p class="lg:col-span-2">
69
+ The first step is to create a web demo from your model. As an example, we will be creating a demo from an image classification model (called model) which we will be uploading to Spaces. The full code for steps 1-4 can be found in this <a href="https://colab.research.google.com/drive/1S6seNoJuU7_-hBX5KbXQV4Fb_bbqdPBk?usp=sharing" style="text-decoration: underline" target="_blank">colab notebook</a>.
70
+ </p><br />
71
+
72
+ <h3 class="my-8 lg:col-span-2" style="font-size:20px; font-weight:bold">1. Install the gradio library
73
+ </h3>
74
+ <p class="lg:col-span-2">
75
+ All you need to do is to run this in the terminal: <code>pip install gradio</code>
76
+ </p>
77
+ <br />
78
+ <h3 class="my-8 lg:col-span-2" style="font-size:20px; font-weight:bold">2. Define a function in your Python code that performs inference with your model on a data point and returns the prediction
79
+ </h3>
80
+ <p class="lg:col-span-2">
81
+ Here’s we define our image classification model prediction function in PyTorch (any framework, like TensorFlow, scikit-learn, JAX, or a plain Python will work as well):
82
+ <pre>
83
+ <code>
84
+ def predict(inp):
85
+
86
+ inp = Image.fromarray(inp.astype('uint8'), 'RGB')
87
+
88
+ inp = transforms.ToTensor()(inp).unsqueeze(0)
89
+
90
+ with torch.no_grad():
91
+
92
+ prediction = torch.nn.functional.softmax(model(inp)[0], dim=0)
93
+
94
+ return {labels[i]: float(prediction[i]) for i in range(1000)}
95
+ </code>
96
+ </pre>
97
+ </p>
98
+
99
+ <h3 class="my-8 lg:col-span-2" style="font-size:20px; font-weight:bold">3. Then create a Gradio Interface using the function and the appropriate input and output types
100
+ </h3>
101
+ <p class="lg:col-span-2">
102
+ For the image classification model from Step 2, it would like like this:
103
+ </p>
104
+ <pre>
105
+ <code>
106
+ inputs = gr.inputs.Image()
107
+
108
+ outputs = gr.outputs.Label(num_top_classes=3)
109
+
110
+ io = gr.Interface(fn=predict, inputs=inputs, outputs=outputs)
111
+ </code>
112
+ </pre>
113
+ <p class="lg:col-span-2">
114
+ If you need help creating a Gradio Interface for your model, check out the Gradio Getting Started guide.
115
+ </p>
116
+
117
+ <h3 class="my-8 lg:col-span-2" style="font-size:20px; font-weight:bold">4. Then launch() you Interface to confirm that it runs correctly locally (or wherever you are running Python)
118
+ </h3>
119
+ <pre>
120
+ <code>
121
+ io.launch()
122
+ </code>
123
+ </pre>
124
+ <p class="lg:col-span-2">
125
+ You should see a web interface like the following where you can drag and drop your data points and see the predictions:
126
+ </p>
127
+ <img class="lg:col-span-2" src="https://i.imgur.com/1hsIgJJ.png" alt="Gradio Interface" style="margin:10px">
128
+ </div>
129
+
130
+
131
+