Skip to content

Commit

Permalink
🐛 Bug: Fix the bug that causes an error in DuckDuckGo search.
Browse files Browse the repository at this point in the history
💻 Code: Upgrade TikToken version to 5.3.0
  • Loading branch information
yym68686 committed Apr 22, 2024
1 parent 75d270f commit b29c45c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ python-telegram-bot[webhooks,rate-limiter]==21.0.1
fake_useragent
openai==0.28.1
google-api-python-client
duckduckgo-search==4.1.0
duckduckgo-search==5.3.0
langchain==0.0.271
oauth2client==3.0.0
pdfminer.six
Expand Down
2 changes: 1 addition & 1 deletion test/test_ddg.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def Web_crawler(url: str) -> str:
# urls = getddgsearchurl1("test")
# urls = getddgsearchurl("你知道今天有什么热点新闻吗")
# urls = getddg("尊嘟假嘟 含义")
urls = getddgsearchurl("它会返回一个包含搜索结果的列表")
urls = getddgsearchurl("你知道今天有什么热点新闻吗")
print(urls)
# for url in urls:
# print(Web_crawler(url))
Expand Down
4 changes: 3 additions & 1 deletion test/test_ollama.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def query_ollama(prompt, model):
# 查询答案
prompt = r'''
详细讲解一下SAFE块是怎么进行进行时间特征聚合的?
The Space-Time Video Super-Resolution (STVSR) task aims to enhance the visual quality of videos, by simultaneously performing video frame interpolation (VFI) and video super-resolution (VSR). However, facing the challenge of the additional temporal dimension and scale inconsistency, most existing STVSR methods are complex and inflexible in dynamically modeling different motion amplitudes. In this work, we find that choosing an appropriate processing scale achieves remarkable benefits in flow-based feature propagation. We propose a novel Scale-Adaptive Feature Aggregation (SAFA) network that adaptively selects sub-networks with different processing scales for individual samples. Experiments on four public STVSR benchmarks demonstrate that SAFA achieves state-of-the-art performance. Our SAFA network outperforms recent state-of-the-art methods such as TMNet [83] and VideoINR [10] by an average improvement of over 0.5dB on PSNR, while requiring less than half the number of parameters and only 1/3 computational costs.
上面的文字翻译成中文
'''
answer = ""
Expand Down
8 changes: 8 additions & 0 deletions test/test_search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from utils.plugins import get_search_results

for i in get_search_results("今天的微博热搜有哪些?"):
print(i)

0 comments on commit b29c45c

Please sign in to comment.