yerang commited on
Commit
a2c05a5
β€’
1 Parent(s): 8679692

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py CHANGED
@@ -1,6 +1,9 @@
1
  import gradio as gr
2
  import spaces
3
  import torch
 
 
 
4
 
5
  zero = torch.Tensor([0]).cuda()
6
  print(zero.device) # <-- 'cpu' πŸ€”
@@ -8,6 +11,19 @@ print(zero.device) # <-- 'cpu' πŸ€”
8
  @spaces.GPU
9
  def greet(n):
10
  print(zero.device) # <-- 'cuda:0' πŸ€—
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  return f"Hello {zero + n} Tensor"
12
 
13
  demo = gr.Interface(fn=greet, inputs=gr.Number(), outputs=gr.Text())
 
1
  import gradio as gr
2
  import spaces
3
  import torch
4
+ import gdown
5
+ import os
6
+ import setup_environment
7
 
8
  zero = torch.Tensor([0]).cuda()
9
  print(zero.device) # <-- 'cpu' πŸ€”
 
11
  @spaces.GPU
12
  def greet(n):
13
  print(zero.device) # <-- 'cuda:0' πŸ€—
14
+
15
+
16
+
17
+ # λ‹€μš΄λ‘œλ“œν•  파일의 곡유 링크
18
+ #file_id = 'your_file_id_here'
19
+ file_id=os.getenv('ZIPFILE_ID')
20
+ url = f"https://drive.google.com/uc?id={file_id}"
21
+
22
+ # 파일 λ‹€μš΄λ‘œλ“œ
23
+ gdown.download(url, '/tmp/', quiet=False)
24
+
25
+
26
+
27
  return f"Hello {zero + n} Tensor"
28
 
29
  demo = gr.Interface(fn=greet, inputs=gr.Number(), outputs=gr.Text())