ThomasSimonini HF staff commited on
Commit
ee12b60
1 Parent(s): a9f18b3

Create utils.py

Browse files
Files changed (1) hide show
  1. utils.py +13 -0
utils.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Based on Omar Sanseviero work
2
+ # Make model clickable link
3
+ def make_clickable_model(model_name):
4
+ # remove user from model name
5
+ model_name_show = ' '.join(model_name.split('/')[1:])
6
+
7
+ link = "https://huggingface.co/" + model_name
8
+ return f'<a target="_blank" href="{link}">{model_name_show}</a>'
9
+
10
+ # Make user clickable link
11
+ def make_clickable_user(user_id):
12
+ link = "https://huggingface.co/" + user_id
13
+ return f'<a target="_blank" href="{link}">{user_id}</a>'