Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,23 +1,10 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from huggingface_hub import notebook_login, HfApi
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
class AdditionModel(torch.nn.Module):
|
| 6 |
-
def __init__(self):
|
| 7 |
-
super(AdditionModel, self).__init__()
|
| 8 |
-
|
| 9 |
-
def forward(self, x1, x2):
|
| 10 |
-
return x1 + x2
|
| 11 |
-
|
| 12 |
-
# Modeli Kaydet
|
| 13 |
-
model = AdditionModel()
|
| 14 |
-
torch.save(model, "addition_model.pth")
|
| 15 |
-
|
| 16 |
-
# Gradio Fonksiyonu
|
| 17 |
def add_numbers(a, b):
|
| 18 |
-
return
|
| 19 |
|
| 20 |
-
# Gradio
|
| 21 |
iface = gr.Interface(
|
| 22 |
fn=add_numbers,
|
| 23 |
inputs=[gr.Number(label="Sayı 1"), gr.Number(label="Sayı 2")],
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
+
# Toplama fonksiyonu
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
def add_numbers(a, b):
|
| 5 |
+
return a + b
|
| 6 |
|
| 7 |
+
# Gradio Arayüzü
|
| 8 |
iface = gr.Interface(
|
| 9 |
fn=add_numbers,
|
| 10 |
inputs=[gr.Number(label="Sayı 1"), gr.Number(label="Sayı 2")],
|