Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,21 +52,22 @@ def predict(text):
|
|
| 52 |
return pipe(text)[0]["translation_text"]
|
| 53 |
|
| 54 |
def main():
|
| 55 |
-
torch.cuda.init()
|
| 56 |
-
if torch.cuda.is_initialized():
|
| 57 |
-
|
| 58 |
-
else:
|
| 59 |
-
|
| 60 |
-
if torch.cuda.is_available():
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
#load_model("stylegan2-ffhq-config-f","feng2022/Time-TravelRephotography_stylegan2-ffhq-config-f")
|
|
|
|
| 65 |
iface = gr.Interface(
|
| 66 |
fn=predict,
|
| 67 |
inputs='text',
|
| 68 |
outputs='text',
|
| 69 |
-
examples=[[f'{
|
| 70 |
)
|
| 71 |
|
| 72 |
iface.launch()
|
|
|
|
| 52 |
return pipe(text)[0]["translation_text"]
|
| 53 |
|
| 54 |
def main():
|
| 55 |
+
#torch.cuda.init()
|
| 56 |
+
#if torch.cuda.is_initialized():
|
| 57 |
+
# ini = "True1"
|
| 58 |
+
#else:
|
| 59 |
+
# ini = "False1"
|
| 60 |
+
#if torch.cuda.is_available():
|
| 61 |
+
# result = "True2"
|
| 62 |
+
# else:
|
| 63 |
+
# result = "False2"
|
| 64 |
#load_model("stylegan2-ffhq-config-f","feng2022/Time-TravelRephotography_stylegan2-ffhq-config-f")
|
| 65 |
+
result = os.system('nvidia-smi')
|
| 66 |
iface = gr.Interface(
|
| 67 |
fn=predict,
|
| 68 |
inputs='text',
|
| 69 |
outputs='text',
|
| 70 |
+
examples=[[f'{result}']]
|
| 71 |
)
|
| 72 |
|
| 73 |
iface.launch()
|