morinop commited on
Commit
3eeeced
1 Parent(s): 8503f33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import gradio as gr
2
  import requests
3
-
4
 
5
  def request_url(url):
6
  headers = {
@@ -14,13 +14,21 @@ def request_url(url):
14
  except requests.RequestException:
15
  return None
16
 
 
 
 
 
17
  import os
 
 
18
  def greet(name):
19
- url = f'https://huggingface.co/spaces?p=1&sort=modified&search=GPT'
20
- html = request_url(url)
21
- key = os.getenv("OPENAI_API_KEY")
 
 
22
 
23
- return "Hello " + key + "!!"
24
 
25
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
26
  iface.launch()
 
1
  import gradio as gr
2
  import requests
3
+ import torch
4
 
5
  def request_url(url):
6
  headers = {
 
14
  except requests.RequestException:
15
  return None
16
 
17
+ import timm
18
+
19
+ model = timm.create_model("hf_hub:nateraw/resnet18-random", pretrained=True)
20
+ model.train()
21
  import os
22
+
23
+
24
  def greet(name):
25
+ # url = f'https://huggingface.co/spaces?p=1&sort=modified&search=GPT'
26
+ # html = request_url(url)
27
+ # key = os.getenv("OPENAI_API_KEY")
28
+ x = torch.randn(1,3,224,224)
29
+ out = model(x)
30
 
31
+ return f"Hello {out.shape} !!"
32
 
33
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
34
  iface.launch()