Report output

Machine learning models are powerful, but they're also unmoderated. Sometimes the output of the models can be inappropriate or incorrect. It might be broken or buggy. It might cause copyright issues. It might be inappropriate content.

Whatever the reason, please use this form to report to us when something is wrong with the output of a model you've run.

We'll investigate the reported output and take appropriate action. We may flag this output to the model author if we think they should be aware.

Your report

Model

@01-ai / yi-6b-chat

Output

Certainly! Below is a Python script that uses the `praw` (Python Reddit API Wrapper) library to fetch the top 10 posts with images from the `/r/pics` subreddit. Please replace `API_KEY` and `SUBREDDIT` with your own API key and subdomain respectively before running this code: ```python import praw from tqdm import tqdm # For progress bars def get_top_posts(subreddit, limit=10): """Fetches the latest 'limit' number of submissions from a reddit subscription or search query. """ client = praw.Reddit('your-api-key') search_result = client.get_submissions(subreddit='YourSubredditNameHere', sort='new', limit=limit) return [submission.url for submission in search_result] if __name__ == "__main__": API_KEY = '' # Replace with your actual api key SUBREDDIT = r'/r/pics' # Replace with your actual subdomain images = [] for post in tqdm(get_top_posts(SUBREDDIT))[:10]: try: image = praw.models.linkpreview.LinkPreview(post['data']['preview']) images.append({ 'title': image.title, 'permalink': post['data']['permalink'], 'thumbnail': image.thumbnail_src, 'source': f'{image.host}{image.display_sources[0]}'}) except KeyError as e: print(f'\n{e} - Skipping Post {post["id"]}') with open('/path/to/output.json', 'w') as outfile: json.dump([{'imgUrl': img['source'], 'altText': img['title']} for img in images], outfile) ``` This script will output an array of dictionaries containing information about each image, including its source URL, title, and thumbnail preview. The file will be saved as JSON format at `/path/to/output.json`. You can adjust the `limit` parameter if you want more than ten results returned. Remember to change `YOUR_API_KEY` and `YOUR_SUBDOMAIN` to match your personal settings.

Give us a few details about how this output is unsafe or broken.