Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,7 +59,35 @@ if st.button("Generate Transcript"):
|
|
| 59 |
st.warning("Token counting not available in current API version")
|
| 60 |
|
| 61 |
# Create prompt template
|
| 62 |
-
prompt_template = Template("""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
prompt = prompt_template.render(speakers=speakers)
|
| 65 |
|
|
|
|
| 59 |
st.warning("Token counting not available in current API version")
|
| 60 |
|
| 61 |
# Create prompt template
|
| 62 |
+
prompt_template = Template("""Generate a transcript of the episode. Include timestamps and identify speakers.
|
| 63 |
+
Speakers are:
|
| 64 |
+
{% for speaker in speakers %}- {{ speaker }}{% if not loop.last %}\n{% endif %}{% endfor %}
|
| 65 |
+
|
| 66 |
+
eg:
|
| 67 |
+
[00:00] Brady: Hello there.
|
| 68 |
+
[00:02] Tim: Hi Brady.
|
| 69 |
+
|
| 70 |
+
It is important to include the correct speaker names. Use the names you identified earlier. If you really don't know the speaker's name, identify them with a letter of the alphabet, eg there may be an unknown speaker 'A' and another unknown speaker 'B'.
|
| 71 |
+
|
| 72 |
+
If there is music or a short jingle playing, signify like so:
|
| 73 |
+
[01:02] [MUSIC] or [01:02] [JINGLE]
|
| 74 |
+
|
| 75 |
+
If you can identify the name of the music or jingle playing then use that instead, eg:
|
| 76 |
+
[01:02] [Firework by Katy Perry] or [01:02] [The Sofa Shop jingle]
|
| 77 |
+
|
| 78 |
+
If there is some other sound playing try to identify the sound, eg:
|
| 79 |
+
[01:02] [Bell ringing]
|
| 80 |
+
|
| 81 |
+
Each individual caption should be quite short, a few short sentences at most.
|
| 82 |
+
|
| 83 |
+
Signify the end of the episode with [END].
|
| 84 |
+
|
| 85 |
+
Don't use any markdown formatting, like bolding or italics.
|
| 86 |
+
|
| 87 |
+
Only use characters from the English alphabet, unless you genuinely believe foreign characters are correct.
|
| 88 |
+
|
| 89 |
+
It is important that you use the correct words and spell everything correctly. Use the context of the podcast to help.
|
| 90 |
+
If the hosts discuss something like a movie, book or celebrity, make sure the movie, book, or celebrity name is spelled correctly.""")
|
| 91 |
|
| 92 |
prompt = prompt_template.render(speakers=speakers)
|
| 93 |
|