Replies: 1 comment
-
fyi |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted it to work in real-time, so I used multiple threads to invoke the model. However, I found that the models couldn't be shared together (I'm not sure why, but it seems reasonable). So I tried two methods:
Method 1: Each thread reads a separate model.
Method 2: During the initialization of the class, the model is read, and then it is deep copied using deepcopy for further usage.
I observed that:
In Method 1, each thread starts reading the model only when the program ends.
In Method 2, the model copy works fine, but the "transcribe" process still begins only when the program ends.
I am curious about the reason behind this behavior. Thank you very much.
Below is the concept of Method 2:
I call this Class in the main program and perform some actions. However, when the main program ends, the last line "result = model.transcribe(file_name, verbose=True, temperature=0.0, language="zh", fp16=True)" starts executing.
Beta Was this translation helpful? Give feedback.
All reactions