Skip to content

feat: 🎸 add inference feature#246

Merged
zezhishao merged 3 commits intoGestaltCogTeam:masterfrom
duyifanict:dev/ustf_inference
Jul 9, 2025
Merged

feat: 🎸 add inference feature#246
zezhishao merged 3 commits intoGestaltCogTeam:masterfrom
duyifanict:dev/ustf_inference

Conversation

@duyifanict
Copy link
Contributor

add experimental script for inference processing

resolved #212

@duyifanict duyifanict requested a review from zezhishao June 18, 2025 06:41
@duyifanict duyifanict force-pushed the dev/ustf_inference branch from 4bda8af to f53f15f Compare June 18, 2025 08:44
add experimental script for inference processing
@duyifanict duyifanict force-pushed the dev/ustf_inference branch from f53f15f to 967d017 Compare June 18, 2025 08:48
add web page and api server for inference processing
@duyifanict duyifanict changed the title feat: 🎸 add inference script feat: 🎸 add inference feature Jun 25, 2025

MODEL_ARCH = TimeMoE

MODEL_PARAM = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from_pretrained 需要使用前面的 pretrained 变量

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

super().__init__(cfg)

# setup graph flag
self.need_setup_graph = cfg['MODEL'].get('SETUP_GRAPH', False)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个变量应该不用。setup_graph 这种做法是只在普通的小模型里面才会用到的,算是历史遗留问题。

很早期的研究(例如 17、18 年)会用 pytorch 语法写 tensorflow 风格的实现(可能是因为他们用惯了 tensorflow)。TF 那时候是静态图,需要在第一次 forward 的时候真正建立计算图,所以才有了这么个参数。后来的大模型都是 pytorch 了,就不需要这个参数了。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

明确不需要此参数,但是推理流程要兼顾小模型和大模型,这里保留参数但固定为false

from easytorch.utils import set_visible_devices

sys.path.append(os.path.abspath(os.path.join(__file__,'..','..','..')))
class inference_engine(object):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里按照规范是不是得加两行空格?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@zezhishao zezhishao merged commit 7c87de0 into GestaltCogTeam:master Jul 9, 2025
2 checks passed
junkim0209 pushed a commit to junkim0209/BasicTS_mjk that referenced this pull request Aug 29, 2025
* feat: 🎸 add inference script

add experimental script for inference processing

* feat: 🎸 add inference server

add web page and api server for inference processing

* update review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[⭐] Add to /experiments a predict.py and forecast.py

2 participants