|
import streamlit as st |
|
|
|
x = st.slider('Select a value') |
|
st.write(x, 'squared is', x * x) |
|
|
|
from transformers import HfApi |
|
|
|
def upload_file_to_huggingface(file_url, filename, api_token): |
|
|
|
response = requests.get(file_url) |
|
file_content = response.content |
|
|
|
|
|
hf_api = HfApi() |
|
hf_api.set_access_token(api_token) |
|
|
|
|
|
hf_api.upload_file(filename, file_content) |
|
|
|
print(f"File uploaded to Hugging Face as {filename}") |
|
|
|
|
|
api_token = '26c6255b595c4aac4c30f7fa6644c1a726b70972_1694005299.jpg' |
|
file_url = 'https://dkstatics-public.digikala.com/digikala-products/26c6255b595c4aac4c30f7fa6644c1a726b70972_1694005299.jpg' |
|
filename = '26c6255b595c4aac4c30f7fa6644c1a726b70972_1694005299.jpg' |
|
|
|
upload_file_to_huggingface(file_url, filename, api_token) |
|
|