20 lines
698 B
Python
20 lines
698 B
Python
from dashscope import BatchTextEmbedding
|
|
import requests
|
|
|
|
def call():
|
|
result = BatchTextEmbedding.call(BatchTextEmbedding.Models.text_embedding_async_v1,
|
|
url="https://modelscope.oss-cn-beijing.aliyuncs.com/resource/text_embedding_file.txt",
|
|
# url='http://127.0.0.1:text_embedding_file.txt'
|
|
text_type="document")
|
|
url = result.output.url
|
|
response = requests.get(url)
|
|
|
|
# 检查请求是否成功
|
|
if response.status_code == 200:
|
|
# 获取网页的 HTML 内容
|
|
html_content = response.text
|
|
print(html_content)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
call() |