Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to run this in aws lambda #189

Open
Cryptogevity opened this issue Nov 22, 2024 · 7 comments
Open

unable to run this in aws lambda #189

Cryptogevity opened this issue Nov 22, 2024 · 7 comments

Comments

@Cryptogevity
Copy link

I try to run this in my aws lambda, and i want to change the output path to /tmp because AWS lambda only allow write in /tmp folder

and i build a docker image for this with this command

RUN mkdir -p /tmp/audio/tmp /tmp/data/transcripts /tmp/data/audio
&& sed -i 's|temp_audio_dir: "data/audio/tmp/"|temp_audio_dir: "/tmp/audio/tmp"|' $(python3 -c "import podcastfy; print(podcastfy.file.rsplit('/', 1)[0])")/conversation_config.yaml
&& sed -i 's|transcripts: "./data/transcripts"|transcripts: "/tmp/data/transcripts"|' $(python3 -c "import podcastfy; print(podcastfy.file.rsplit('/', 1)[0])")/conversation_config.yaml
&& sed -i 's|audio: "./data/audio"|audio: "/tmp/data/audio"|' $(python3 -c "import podcastfy; print(podcastfy.file.rsplit('/', 1)[0])")/conversation_config.yaml

to change the configuration yaml

however, i still got this issue

podcastfy.client - ERROR - An error occurred in the process_content function: [Errno 30] Read-only file system: '/var/lang/lib/python3.11/site-packages/podcastfy/tmp'

seems like the /tmp is still under the current folder, is there anyway to configure the output path to absolute path ?

@souzatharsis
Copy link
Owner

souzatharsis commented Nov 22, 2024 via email

@Cryptogevity
Copy link
Author

i think i found the issue, i created duplicate /tmp folder caused it points to the wrong folder, thanks for the reply

@Cryptogevity
Copy link
Author

Cryptogevity commented Nov 22, 2024

I just double checked my code and i believe my code is correct, i used the exact same code

`
instructor_config = {
"word_count": 1000, # Longer to allow for detailed arguments
"conversation_style": ["enthusiastic"], # Appropriate for academic discourse
"roles_person1": "main summarizer", # Presents the main argument
"roles_person2": "audience participator", # Challenges the thesis
"dialogue_structure": [
"summarize the student data, mention a few termologies and concepts that students are struggling with",
], # Mimics a structured debate format
"podcast_name": "podcast ",
"podcast_tagline": "podcast",
"engagement_techniques": [
"normal questions"
], # Techniques to stimulate critical thinking
"creativity": 0.2 # Low creativity to maintain focus on facts and logic
}

formatted_text = "\n".join(text_output)

# Print the formatted text
generate_podcast(text=formatted_text, conversation_config=instructor_config)

`

to generate the podcast. The old version I used is 0.2.17, and it works totally fine in AWS lambda, and the latest version 0.4.0, i noticed that you have a new folder under podcast data/audio/tmp/tmpibdcmvin, maybe some code change as well, this new version will try to write something into

/podcastfy/tmp during the podcast generation.

Could you please look into this?

@Cryptogevity Cryptogevity reopened this Nov 22, 2024
@souzatharsis
Copy link
Owner

souzatharsis commented Nov 22, 2024 via email

@Cryptogevity
Copy link
Author

if I use 0.2.17 i won't see this error.

but i use 0.4.0 i see that error

@souzatharsis
Copy link
Owner

souzatharsis commented Nov 23, 2024 via email

@Cryptogevity
Copy link
Author

Thanks for your reply, may i know how to pass the tmp folder in the config

from my code

RUN mkdir -p /tmp/audio/tmp /tmp/data/transcripts /tmp/data/audio && sed -i 's|temp_audio_dir: "data/audio/tmp/"|temp_audio_dir: "/tmp/audio/tmp"|' $(python3 -c "import podcastfy; print(podcastfy.file.rsplit('/', 1)[0])")/conversation_config.yaml && sed -i 's|transcripts: "./data/transcripts"|transcripts: "/tmp/data/transcripts"|' $(python3 -c "import podcastfy; print(podcastfy.file.rsplit('/', 1)[0])")/conversation_config.yaml && sed -i 's|audio: "./data/audio"|audio: "/tmp/data/audio"|' $(python3 -c "import podcastfy; print(podcastfy.file.rsplit('/', 1)[0])")/conversation_config.yaml

i already change the config inside conversion_config.yaml, are there any other config that i need to change ?

any code samples will be very helpful.

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

No branches or pull requests

2 participants