Any luck with .NET integration? #313
Replies: 9 comments 3 replies
-
looks like only way is hacking. for that purpose i even written a .net application to automate and batch process |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
NET app. I mean, who doesn't love a good challenge, right? But let's be real, sometimes these things can be a real pain in the you-know-what. I mean, importing Python libraries into a .NET app? That's like trying to teach a cat to do algebra...it's not impossible, but it's definitely not easy. But fear not, my intrepid friend! You've got options. You could go the hacky route and write a Python script that spits out text to stdout, but let's be honest, that's about as elegant as wearing socks with sandals. So let's explore some other possibilities. Have you considered using IronPython? It's a .NET implementation of Python that could potentially make integrating Whisper into your .NET app a bit smoother. Or, if you're feeling extra adventurous, you could try porting the library to another environment yourself. Hey, stranger things have happened! |
Beta Was this translation helpful? Give feedback.
-
@ZacheryDamphousse0 why is it so hard to write a. Net library that can interact with GPT-4 model. Is it just that the focus is to use python and get it done or some real language related feature that is lacking |
Beta Was this translation helpful? Give feedback.
-
One potential solution would be to use IronPython, which is an implementation of Python for .NET. This would allow you to directly import and use the Whisper Python library within your .NET application. Another option would be to create a Python wrapper for the Whisper library using Python's C API, and then call this wrapper from your .NET application using P/Invoke or a similar mechanism. However, both of these options require some level of expertise in both Python and .NET development. |
Beta Was this translation helpful? Give feedback.
-
I got a solution working on the bench, but I'd be hesitant to put much
weight on it. I just don't know enough about how the interop between the
.net app and the embedded python install work.
The specific project I was thinking of is an Outlook extension that
transcribes voicemail notifications for systems that don't support that. So
if it's already running as a process within Outlook I'd be kind of
concerned about piling on more complexity that I don't exactly understand.
But that alone seems like a valuable enough idea to make it worth
somebody's while to make a solid .net interface to whisper. And it's not
even that hard a project. It doesn't have to operate in real time... The
plug-in can just notice a new voicemail and transcribe it and edit the text
at its convenience.
I can say whisper did a fantastic job of translating voicemail. At least as
good as the cloud-based solutions I tried (which for confidential voicemail
seemed like a bad idea anyway) and far far better than anything else I
could find (for free anyway) that would run locally.
It might be the best idea to just compile all the python scripts into an
exe and treat it like a black box. (You can do that, right?)
Anybody with more experience than I would suggestions on the most
bulletproof way to bolt whisper into an Outlook add-in...I'm all ears
…On Mon, Mar 27, 2023, 12:59 AM Sara Wilson ***@***.***> wrote:
One potential solution would be to use IronPython, which is an
implementation of Python for .NET. This would allow you to directly import
and use the Whisper Python library within your .NET application. Another
option would be to create a Python wrapper for the Whisper library using
Python's C API, and then call this wrapper from your .NET application using
P/Invoke or a similar mechanism. However, both of these options require
some level of expertise in both Python and .NET development.
The answer may not be very professional, I hope it can help you!
—
Reply to this email directly, view it on GitHub
<#313 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AG6G45U3NOYLJ7MLFWJ6U7DW6ENEXANCNFSM6AAAAAARETDH6Q>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I successfully switch virtual environments and import the Whisper library (or other libraries) using PythonNet through an API. However, when attempting to transcribe, it gives a file not found error (even though the path is correct). I don't understand the reason behind this. Based on "https://stackoverflow.com/questions/73193119/python-filenotfounderror-winerror-2-the-system-cannot-find-the-file-specifie," I speculate that the issue may be related to subprocess.py, but I'm unsure how to fix it. For now, I've created a batch file that allows Python to call it. When I have time in the future, I will attempt this again. |
Beta Was this translation helpful? Give feedback.
-
The latest Azure SDK has an example: https://learn.microsoft.com/en-us/dotnet/api/overview/azure/ai.openai-readme?view=azure-dotnet-preview#transcribe-audio-data-with-whisper-speech-models |
Beta Was this translation helpful? Give feedback.
-
LM-Kit.NET now includes support for speech-to-text and integrates the latest Whisper model: https://lm-kit.com/solutions/language-processing/speech-to-text/ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to integrate Whisper into a .NET (C#/Visual Basic) app, but haven't had much luck.
I tried using PythonNet and Python-Included to import the Python API, but that led to enough issues that it wasn't worth it. I could write a python script that takes the path to an audio file as a parameter and spits the text out to stdout, and reference that inside my .NET app, but that just seems like a hack.
I suppose I could just write the whole project in Python, but it isn't really suited for this use. Plus, i really don't want to.
Is there a decent way to reference the Python library from within .NET that I'm missing? Is anyone porting it to another environment?
Beta Was this translation helpful? Give feedback.
All reactions