Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
# 测试文本模型
|
| 2 |
# import part
|
| 3 |
import streamlit as st
|
| 4 |
-
from transformers import pipeline
|
| 5 |
-
import torch
|
| 6 |
-
pipe = pipeline("text-classification", model="distilbert-base-uncased")
|
| 7 |
-
print(pipe("This is a test sentence."))
|
| 8 |
|
| 9 |
-
# 测试视觉模型
|
| 10 |
-
from PIL import Image
|
| 11 |
-
import requests
|
| 12 |
-
pipe = pipeline("image-classification", model="google/vit-base-patch16-224")
|
| 13 |
-
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
| 14 |
-
print(pipe(Image.open(requests.get(url, stream=True).raw)))
|
|
|
|
| 1 |
# 测试文本模型
|
| 2 |
# import part
|
| 3 |
import streamlit as st
|
| 4 |
+
# from transformers import pipeline
|
| 5 |
+
# import torch
|
| 6 |
+
# pipe = pipeline("text-classification", model="distilbert-base-uncased")
|
| 7 |
+
# print(pipe("This is a test sentence."))
|
| 8 |
|
| 9 |
+
# # 测试视觉模型
|
| 10 |
+
# from PIL import Image
|
| 11 |
+
# import requests
|
| 12 |
+
# pipe = pipeline("image-classification", model="google/vit-base-patch16-224")
|
| 13 |
+
# url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
| 14 |
+
# print(pipe(Image.open(requests.get(url, stream=True).raw)))
|