Spaces:
Build error
Build error
SefyanKehail
commited on
Commit
·
e0a0101
1
Parent(s):
9185c84
hii
Browse files
app.py
CHANGED
|
@@ -5,10 +5,9 @@ import torch.nn as nn
|
|
| 5 |
import torch.optim as optim
|
| 6 |
from torchvision import datasets, transforms
|
| 7 |
from torch.utils.data import DataLoader
|
| 8 |
-
from huggingface_hub import
|
| 9 |
-
from huggingface_hub import
|
| 10 |
-
|
| 11 |
-
HfFolder.save_token("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")
|
| 12 |
|
| 13 |
class SimpleNet(nn.Module):
|
| 14 |
def __init__(self):
|
|
@@ -49,10 +48,6 @@ def train_model(epochs):
|
|
| 49 |
|
| 50 |
# Save the model checkpoint
|
| 51 |
torch.save(model.state_dict(), "simple_net.pth")
|
| 52 |
-
repo = Repository(local_dir="https://huggingface.co/spaces/Transduce/vc_demo_clean")
|
| 53 |
-
repo.git_add(file_paths="simple_net.pth")
|
| 54 |
-
repo.git_commit("model checkpoint")
|
| 55 |
-
repo.git_push()
|
| 56 |
return "Training completed and model saved."
|
| 57 |
|
| 58 |
# Define the Gradio interface
|
|
|
|
| 5 |
import torch.optim as optim
|
| 6 |
from torchvision import datasets, transforms
|
| 7 |
from torch.utils.data import DataLoader
|
| 8 |
+
# from huggingface_hub import HfFolder
|
| 9 |
+
# from huggingface_hub import Repository
|
| 10 |
+
# HfFolder.save_token("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")
|
|
|
|
| 11 |
|
| 12 |
class SimpleNet(nn.Module):
|
| 13 |
def __init__(self):
|
|
|
|
| 48 |
|
| 49 |
# Save the model checkpoint
|
| 50 |
torch.save(model.state_dict(), "simple_net.pth")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
return "Training completed and model saved."
|
| 52 |
|
| 53 |
# Define the Gradio interface
|