feng2022 commited on
Commit
1f683a7
·
1 Parent(s): 229a558

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
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
- 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
  iface = gr.Interface(
66
  fn=predict,
67
  inputs='text',
68
  outputs='text',
69
- examples=[[f'{ini} {result}']]
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()