Spaces:
Paused
Paused
AutoModel test
Browse files
app.py
CHANGED
@@ -1,14 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
-
import
|
3 |
-
import torch
|
4 |
|
5 |
-
|
6 |
-
|
|
|
7 |
|
8 |
-
|
9 |
-
|
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())
|
14 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import AutoModel
|
|
|
3 |
|
4 |
+
def get_model_summary(model_name):
|
5 |
+
model = AutoModel.from_pretrained(model_name)
|
6 |
+
return str(model)
|
7 |
|
8 |
+
interface = gr.Interface(fn=get_model_summary, inputs="text", outputs="text")
|
9 |
+
interface.launch()
|
|
|
|
|
|
|
|
|
|