Jump to content

ChatFred: OpenAI's GPT-model workflow


Recommended Posts

11 hours ago, Sunday said:

Like when you asked ChatGPT to write a poem, what program is the poem displayed in?


It’s Alfred, showing Large Type.

 

11 hours ago, Sunday said:

but cf is not working and Alfred just suggests Google, Amazon, etc.


Check the debugger to see what’s happening.

 

11 hours ago, albertkinng said:

It simply stops working.


You know from previous interactions that is seldom the case. It’s absolutely fine that you’re not a computer expert, but to solve your issues you need to help us help you. When you ignore the advice and pointers others give to you it makes the interaction frustrating, especially for yourself.


Again, it’s Shortcuts doing the work of connecting to the API. It is even possible to tell from the screenshots. And again, it’s fine if you’re not able to see the difference, but if you’re asking for help you need to have some trust in the people you’re asking. There are several users in this forum with experience in these matters, and from what I’ve seen everyone has been striving to give you correct information. But you have to be willing to take it for the conversation to be productive.

 

Edited by vitor
Link to comment

Thank you session extraordinaire much @chrislemke for this amazing workflow. I use it all day (and I don't really know if I'm paying anything since I didn't pay for ChatGpt Plus yet). 

 

I had two questions : if I subscribe to ChatGpt Plus, will the answer be shown more rapidly using your Workflow ? 

Also, is there a way  to use Whisper's audio transcription within the Workflow ? 

 

Regards, 

Link to comment
1 hour ago, albertkinng said:

Why I can’t use ChatFred if I still have free time?

IMG_6756.jpeg

Hey @albertkinng!

If I am not mistaken your your free 18$ expired on April 1. Did you add some Credit Cards? Since this Workflow uses the API the usage will not be for free but I also use it all day long. And on average I pay less than 0.04$ a day.

Edited by chrislemke
Link to comment
On 4/6/2023 at 5:55 PM, chrislemke said:

Hey @albertkinng!

If I am not mistaken your your free 18$ expired on April 1. Did you add some Credit Cards? Since this Workflow uses the API the usage will not be for free but I also use it all day long. And on average I pay less than 0.04$ a day.

Hi @chrislemke I don't find the option to top up the balance. Request you to guide or suggest a direct link? 

 

Is it possible to see all API calls on chatGPT dashboard? How do you set multiple transformations in the workflow? Like Summarize in a few sentences or Give the top 2-3 keywords?  

 

 

Link to comment
2 hours ago, TomBenz said:

Hi @chrislemke I don't find the option to top up the balance. Request you to guide or suggest a direct link? 

 

Is it possible to see all API calls on chatGPT dashboard? How do you set multiple transformations in the workflow? Like Summarize in a few sentences or Give the top 2-3 keywords?  

 

 

Hey @TomBenz!

As far as I know, you can not top up your balance. You have to add a Credit Card to keep using it once your free credits are empty or expired. 

It is not possible to see all API calls in the dashboard. Concerning your question about "multiple transformations" I guess you are referring to the InstructGPT models and not to ChatGPT, right? The InstructGPT implementation is actually pretty simple it does not provide a lot of functionality. 

 

I agree with you sometimes the speed is not really good. I was already working on it to improve it. Unfortunately, it is the API call itself that takes 99% of the time. It seems that OpenAI gives its own Website UI a higher priority.    

Link to comment
8 hours ago, chrislemke said:

Hey @TomBenz!

As far as I know, you can not top up your balance. You have to add a Credit Card to keep using it once your free credits are empty or expired. 

It is not possible to see all API calls in the dashboard. Concerning your question about "multiple transformations" I guess you are referring to the InstructGPT models and not to ChatGPT, right? The InstructGPT implementation is actually pretty simple it does not provide a lot of functionality. 

 

I agree with you sometimes the speed is not really good. I was already working on it to improve it. Unfortunately, it is the API call itself that takes 99% of the time. It seems that OpenAI gives its own Website UI a higher priority.    

 

Transformation using chatGPT itself. Below is the screenshot

 

image.thumb.png.41164220ba9cebd451408e3cea3596e4.png

 

I use universal action and use send to chatGPT (press shift key) and get a summary or re-phrased version of the content. would like to see how I can get multiple options such as "summarize", and "list top 10 bullet points" in universal action on selected text. 

Link to comment
4 minutes ago, TomBenz said:

 

Transformation using chatGPT itself. Below is the screenshot

 

image.thumb.png.41164220ba9cebd451408e3cea3596e4.png

 

I use universal action and use send to chatGPT (press shift key) and get a summary or re-phrased version of the content. would like to see how I can get multiple options such as "summarize", and "list top 10 bullet points" in universal action on selected text. 

Ah, got it. Sorry for my misunderstanding. There are two ways to archive your goal. But to be fair non of them is really perfect. The first one is to change the transformation prompt. But I guess that is not really helpful. The other solution is to store the first prompt like "summarize this text" and then append another prompt using the universal action. Check out the Combined prompts in the Universal action & combined prompts section. 

 

I also just released a new version to improve combining the functionality of automatically pasting the response to the frontmost app and the transformation feature. If you are interested just check out the first section: Talk to ChatGPT. At the end of it, I added an example of how to let ChatGPT write documentation for Python code. Maybe this can also be interesting for you.

 

You actually have a good point concerning providing the functionality to have multiple text transformation texts. Maybe you have a cool idea on how to implement it? Feel free two write about your idea in the New Ideas thread.

Link to comment

I am not able to get this to work.

I type "CF joke" and Alfred is stuck at displaying "ChatFred loading"

Nothing happens.

I have installed the latest version 1.4 of the workflow and have inserted my ChatGPT API key as instructed.
ChatGPT web works for my account.

What am I doing wrong?

Link to comment
7 hours ago, s95hc8 said:

I am not able to get this to work.

I type "CF joke" and Alfred is stuck at displaying "ChatFred loading"

Nothing happens.

I have installed the latest version 1.4 of the workflow and have inserted my ChatGPT API key as instructed.
ChatGPT web works for my account.

What am I doing wrong?

Hey @s95hc8!

Did you have a look at the troubleshooting section? Otherwise, I would need a bit more information like the debugger printout to help you effectively. 

Link to comment

Thanks a lot!

I am not a programmer and I had major major major issues to walk though the steps of troubleshooting the whole Xcode home-brew python situation.
In essence this is all Chinese to me.
Somehow ChatFred is working now despite I never got Homebrew installed correctly and Python does not respond in terminal yet I installed it with an installer from the python website.

ChatFred works.

A few questions:

1)
Is there a way to significantly reduce the time of "ChatGPT is thinking" ?
When using ChatGPT through the web portal it responds much much quicker (yes it does the very annoying "type along thing" that makes using it quickly a bit inefficient and hard to read) but overall it seems more responsive.
Is this an unavoidable issue with the Alfred workflow or can I do something to make it more responsive?

2)
Can the type be user adjusted? It is veeery large.

3)
How can I copy and paste from the output window?
I am not using ChatGPT at all for just informational reading as of its unreliable nature (I rather use search engines for that) but I like ChatGPT to create scripts but I cannot copy content from the ChatFred output - it just disappears.
Ideally I could just CMD+A and CMD+C to mark all output and copy to clipboard to be able to paste and edit it in a text editor right away.
That would be very useful.

4)
Is there a way to mirror the nice formatting of text in scripts as it appears in the ChatGPT web interface?
ChatFred outputs only unformatted text (one type and one color without visual formatting of scripts).

5)
Alfred is my major tool to interact with MacOS (I prefer to use Alfred to launch apps, start web searches, …).
While ChatFred is busy Alfred is inaccessible.
Is there a way to have ChatFred operate "in the background" and still be able to use Alfred normally while waiting for ChatGPT to output?

Link to comment

Hey @s95hc8!

Sorry that the troubleshooting section was not helpful. If you need any further help please let me know. 

 

Here are the answers to your question:

1) Unfortunately there is no way to speed up the workflow. It seems that OpenAI gives higher priority to their WebUI than to the API. I hope this will improve soon.

 

2) If you want to change the size of the text you can change it in the workflow. Check the screenshot to see where to find it.

 

3) There are multiple ways to archive this. By default, ChatFred pastes ChatGPT's response automatically to Alfred's clipboard history. You can also set the Paste response to frontmost app in the workflow's configuration so that ChatFred will not show the response in the dissipating window but will paste it to the frontmost app.

 

4) I'm not really sure what are you talking about but the response from the OpenAI API is usually just plain text. 

 

5) You actually don't have to wait for the response of ChatFred. Since it will automatically copy the response to Alfred's clipboard history you can continue working with Alfred and come back to ChatFred's response whenever needed. Just open the clipboard history and find the response.

 

You may want to have a look at the documentation. It may be a bit long and confusing but maybe you find some help. 

 

I hope this was somehow helpful. 

Screenshot 2023-04-10 at 15.19.39.png

Edited by chrislemke
Link to comment
20 hours ago, chrislemke said:

Cool! Let me know if you need any more help.

Thanks so much.
The troubleshooting is very useful. It is just difficult for non programmers to deal with any issues during installation of Xcode, home-brew and python as they appear if attempted through terminal without automatic package installers.

Thank you very much for the clear answers and tips. It helped a lot!

Link to comment
12 minutes ago, TomBenz said:

I think the reference is to Python etc code properly formatted and shown in the chatGPT web browser.

 

The API’s response is likely to be plain text. So it depends entirely on if the message is already formatted and/or provides some parseable information regarding the highlight/language.

 

For example, they may have ChatGPT come up with the answer but then use a JavaScript library to do the highlighting. That would allow them to show it in the web interface but not show it in the API’s response.

Link to comment
3 minutes ago, TomBenz said:

I think the reference is to Python etc code properly formatted and shown in the chatGPT web browser.

In this case, ChatGPT's API returns three backticks (```) as plain text. I thought about handling them in a certain way but it will be hard to distinguish if the backticks are a part of the response or a formatting character.

Link to comment
2 hours ago, s95hc8 said:

It is just difficult for non programmers to deal with any issues during installation of Xcode, home-brew and python as they appear if attempted through terminal without automatic package installers.

 

For future reference: in this case you shouldn’t have had to mess with the Terminal because as soon as the workflow tried to run python the first time you’d get a GUI prompt from macOS to install the Developer Tools (which in turn make python available).


The most likely cause for the prompt to not appear is that you’d have installed the Developer Tools tool in the past (so macOS was finding them) but due to a macOS update they were broken (it’s relatively rare but the most common reason).


To fix that, all you need it to open a terminal and run /usr/bin/xcode-select --install to force the GUI prompt to show up.

Link to comment
On 4/3/2023 at 6:27 AM, chrislemke said:

 

 

Concerning Whisper, I have not found a Alfred workflow which uses it for pure transcription but maybe we can implement this feature in ChatFred. You could open an issue for it. 

 

@chrislemke Let me know if you have found time for this transcription feature request. This is Python code that works. I will have to pass the filename via universal action and create a transcript file with the same base name and the same location. 

 

import whisper

model = whisper.load_model("base")

# load audio and pad/trim it to fit 30 seconds
audio = whisper.load_audio("/Users/newadmin/Downloads/Aqua.mp3")
audio = whisper.pad_or_trim(audio)

# make log-Mel spectrogram and move to the same device as the model
mel = whisper.log_mel_spectrogram(audio).to(model.device)

# detect the spoken language
_, probs = model.detect_language(mel)
print(f"Detected language: {max(probs, key=probs.get)}")

# decode the audio
options = whisper.DecodingOptions()
result = whisper.decode(model, mel, options)

# print the recognized text
print(result.text)

Link to comment

Hey @TomBenz!

Thanks for your contribution and the code example. I was actually already looking into it. The problem is, that the whisper model is huge and most of them would blow up the workflow. At the moment I am having a look at this

from faster_whisper import WhisperModel

model_size = "tiny"

model = model = WhisperModel(model_size, device="cpu", compute_type="int8")



segments, info = model.transcribe("SOME_FILE.mp3", beam_size=5)

print("Detected language '%s' with probability %f" % (info.language, info.language_probability))

for segment in segments:
    print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))

 

It is not only smaller and does not use so much CPU but it is also much much faster. Try it out. You can also change the model_size to: "tiny", "tiny.en", "base", "base.en", "small", "small.en", "medium", "medium.en", "large-v1", or "large-v2".

Link to comment
18 hours ago, chrislemke said:

Hey @TomBenz!

Thanks for your contribution and the code example. I was actually already looking into it. The problem is, that the whisper model is huge and most of them would blow up the workflow. At the moment I am having a look at this

from faster_whisper import WhisperModel

model_size = "tiny"

model = model = WhisperModel(model_size, device="cpu", compute_type="int8")



segments, info = model.transcribe("SOME_FILE.mp3", beam_size=5)

print("Detected language '%s' with probability %f" % (info.language, info.language_probability))

for segment in segments:
    print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))

 

It is not only smaller and does not use so much CPU but it is also much much faster. Try it out. You can also change the model_size to: "tiny", "tiny.en", "base", "base.en", "small", "small.en", "medium", "medium.en", "large-v1", or "large-v2".

Thanks @chrislemke This works well. I will have to test more to compare CPU and memory. Is it possible to give mp4 file and extract a transcript of it? else it will two-step process 1. extra audio from mp4 files 2. use newly generated mp3 file to create a transcript. 

 

Finally would like to see proper grammar, and punctuation to the extent feasible and a lesser number of time stamps as compared to standard format VTT. MS Teams is adding such a feature for all meetings as an add-on paid feature possibly using chatGPT in background.

Link to comment
13 hours ago, TomBenz said:

Thanks @chrislemke This works well. I will have to test more to compare CPU and memory. Is it possible to give mp4 file and extract a transcript of it? else it will two-step process 1. extra audio from mp4 files 2. use newly generated mp3 file to create a transcript. 

 

Finally would like to see proper grammar, and punctuation to the extent feasible and a lesser number of time stamps as compared to standard format VTT. MS Teams is adding such a feature for all meetings as an add-on paid feature possibly using chatGPT in background.

@chrislemke I tried using mp4 files and it works directly. So there is no need to convert to mp3. The desired output is 1) VTT file with a timestamp to be used as a transcript file with video and 2) another output in docx format with no timestamp.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...