All Projects → gagan3012 → project-code-py

gagan3012 / project-code-py

Licence: MIT license
Leetcode using AI

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to project-code-py

leetcode
LeetCode Solutions https://t.me/vladtenlive
Stars: ✭ 182 (+82%)
Mutual labels:  leetcode
fastT5
⚡ boost inference speed of T5 models by 5x & reduce the model size by 3x.
Stars: ✭ 421 (+321%)
Mutual labels:  transformer
php-serializer
Serialize PHP variables, including objects, in any format. Support to unserialize it too.
Stars: ✭ 47 (-53%)
Mutual labels:  transformer
keras-vision-transformer
The Tensorflow, Keras implementation of Swin-Transformer and Swin-UNET
Stars: ✭ 91 (-9%)
Mutual labels:  transformer
R-MeN
Transformer-based Memory Networks for Knowledge Graph Embeddings (ACL 2020) (Pytorch and Tensorflow)
Stars: ✭ 74 (-26%)
Mutual labels:  transformer
ru-dalle
Generate images from texts. In Russian
Stars: ✭ 1,606 (+1506%)
Mutual labels:  transformer
CS Interview Notes
Interview Preparation Notes
Stars: ✭ 19 (-81%)
Mutual labels:  leetcode
VickyBytes
Subscribe to this GitHub repo to access the latest tech talks, tech demos, learning materials & modules, and developer community updates!
Stars: ✭ 48 (-52%)
Mutual labels:  ml
ViTs-vs-CNNs
[NeurIPS 2021]: Are Transformers More Robust Than CNNs? (Pytorch implementation & checkpoints)
Stars: ✭ 145 (+45%)
Mutual labels:  transformer
streamlit-project
This repository provides a simple deployment-ready project layout for a Streamlit app. Simply swap out the code in `app.py` for your own and hit deploy!
Stars: ✭ 33 (-67%)
Mutual labels:  streamlit
Representation-Learning-for-Information-Extraction
Pytorch implementation of Paper by Google Research - Representation Learning for Information Extraction from Form-like Documents.
Stars: ✭ 82 (-18%)
Mutual labels:  transformer
leetcode
JavaScript Solution. Generated by https://github.com/duteng/fetch-leetcode-submission
Stars: ✭ 38 (-62%)
Mutual labels:  leetcode
osdg-tool
OSDG is an open-source tool that maps and connects activities to the UN Sustainable Development Goals (SDGs) by identifying SDG-relevant content in any text. The tool is available online at www.osdg.ai. API access available for research purposes.
Stars: ✭ 22 (-78%)
Mutual labels:  ml
Interview DS Algo
Super Repository for Coding Interview Preperation
Stars: ✭ 514 (+414%)
Mutual labels:  leetcode
Algorithm
Record daily training algorithms and data structures by Swift
Stars: ✭ 12 (-88%)
Mutual labels:  leetcode
Awesome-low-level-vision-resources
A curated list of resources for Low-level Vision Tasks
Stars: ✭ 35 (-65%)
Mutual labels:  transformer
CP
Competitive Coding
Stars: ✭ 25 (-75%)
Mutual labels:  leetcode
6companies30days
Challenge to solve 90 questions from 6 companies in 30 days. Solved 90/90.
Stars: ✭ 99 (-1%)
Mutual labels:  leetcode
industrial-ml-datasets
A curated list of datasets, publically available for machine learning research in the area of manufacturing
Stars: ✭ 45 (-55%)
Mutual labels:  ml
deprecated-coalton-prototype
Coalton is (supposed to be) a dialect of ML embedded in Common Lisp.
Stars: ✭ 209 (+109%)
Mutual labels:  ml

Leetcode using AI 🤖

GPT-2 Model for Leetcode Questions in python New demo here: https://huggingface.co/spaces/gagan3012/project-code-py

Note: the Answers might not make sense in some cases because of the bias in GPT-2 Current accuracy is capped at 90%.

Contribtuions: If you would like to make the model/UI better contributions (Issues/PRs) are welcome Check out CONTRIBUTIONS

How I built this : Linkedin

📢 Favour:

It would be highly motivating, if you can STAR this repo if you find it helpful. New improvements incoming!

Model

Two models have been developed for different use cases and they can be found at https://huggingface.co/gagan3012

The model weights can be found here: GPT-2 and DistilGPT-2

The model has been trained using Weights and Biases (Wandb) and PyTorch

GPT Neo model: https://huggingface.co/gagan3012/project-code-py-neo

Example usage:

from transformers import AutoTokenizer, AutoModelWithLMHead

tokenizer = AutoTokenizer.from_pretrained("gagan3012/project-code-py")

model = AutoModelWithLMHead.from_pretrained("gagan3012/project-code-py")

Demo

Streamlit App

A streamlit webapp has been setup to use the model: https://share.streamlit.io/gagan3012/project-code-py/app.py

image

Please create an issue in this repo if the demo is not working

Example results:

Question:

Write a function to delete a node in a singly-linked list. You will not be given access to the head of the list, instead you will be given access to the node to be deleted directly. It is guaranteed that the node to be deleted is not a tail node in the list.

Answer:

""" Write a function to delete a node in a singly-linked list. You will not be given access to the head of the list, instead you will be given access to the node to be deleted directly. It is guaranteed that the node to be deleted is not a tail node in the list.

For example,
a = 1->2->3
b = 3->1->2
t = ListNode(-1, 1)

Note: The lexicographic ordering of the nodes in a tree matters. Do not assign values to nodes in a tree.
Example 1:

Input: [1,2,3]
Output: 1->2->5
Explanation: 1->2->3->3->4, then 1->2->5[2] and then 5->1->3->4.


Note:

The length of a linked list will be in the range [1, 1000].
Node.val must be a valid LinkedListNode type.
Both the length and the value of the nodes in a linked list will be in the range [-1000, 1000].
All nodes are distinct.
"""
# Definition for singly-linked list.
# class ListNode:
#     def __init__(self, x):
#         self.val = x
#         self.next = None

class Solution:
    def deleteNode(self, head: ListNode, val: int) -> None:
        """
        BFS
        Linked List
        :param head: ListNode
        :param val: int
        :return: ListNode
        """
        if head is not None:
            return head
        dummy = ListNode(-1, 1)
        dummy.next = head
        dummy.next.val = val
        dummy.next.next = head
        dummy.val = ""


s1 = Solution()
print(s1.deleteNode(head))
print(s1.deleteNode(-1))
print(s1.deleteNode(-1))
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].